当前位置:   article > 正文

ABAP(除数,四舍五入,向上取整,向下取整_abap 除法取整数

abap 除法取整数
  1. REPORT Y_CLY_S1.
  2. START-OF-SELECTION.
  3. DATA: LFIMG TYPE I VALUE '4'.
  4. DATA: NETWR1 TYPE P LENGTH 10 DECIMALS 2 VALUE '40.14'.
  5. DATA: OVER2 TYPE P LENGTH 10 DECIMALS 3.
  6. DATA: OVER1 TYPE P LENGTH 10 DECIMALS 2.
  7. DATA: RUN TYPE P LENGTH 10 DECIMALS 2.
  8. WRITE: /.
  9. OVER2 = NETWR1 / LFIMG.
  10. WRITE: / '正常取值',NETWR1,'/', LFIMG ,OVER2.
  11. OVER2 = NETWR1 / LFIMG.
  12. WRITE: / '正常取值',NETWR1,'/', LFIMG ,OVER2.
  13. WRITE: /.
  14. OVER1 = NETWR1 / LFIMG.
  15. WRITE: / '四舍五入',NETWR1,'/', LFIMG ,OVER1.
  16. OVER1 = NETWR1 / LFIMG.
  17. WRITE: / '四舍五入',NETWR1,'/', LFIMG ,OVER1.
  18. WRITE: /.
  19. RUN = CEIL( NETWR1 / LFIMG ).
  20. WRITE: / '向上取整',OVER2,RUN.
  21. RUN = FLOOR( NETWR1 / LFIMG ).
  22. WRITE: / '向下取整',OVER2,RUN.

 

本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号