其他分享
首页 > 其他分享> > ABAP——ROUND函数小数位取整

ABAP——ROUND函数小数位取整

作者:互联网

lv_string为输入的数值,
lv_string2为需要保留小数位数
sign为判断是需要向上取整还是向下取整,+是向上,-是向下

  DATA:lv_string TYPE p DECIMALS 10.
  DATA:lv_string2 TYPE p VALUE '3'.
        CALL FUNCTION 'ROUND'
          EXPORTING
            decimals = lv_string2
            input    = lv_string
            sign     = '+'
          IMPORTING
            output   = lv_string
*         EXCEPTIONS
*           INPUT_INVALID       = 1
*           OVERFLOW = 2
*           TYPE_INVALID        = 3
*           OTHERS   = 4
          .

标签:string,TYPE,sign,lv,ABAP,取整,小数位,string2
来源: https://blog.csdn.net/weixin_42559610/article/details/115668730