abap 使用数学函数去掉后置0
data:w_p(13)typepdecimals3value'12.120',
w_p2(13)typepdecimals3,
w_c(13)typec,
w_itypeivalue1.
do3times.
w_p2=w_p*w_i.
ifFRAC(w_p2)=0.
exit.
else.
w_i=w_i*10.
continue.
endif.
enddo.
w_c=TRUNC(w_p2)/w_i.
write:/w_p,"12.120
/w_p2,"1,212.000
/w_c."12.12
另:SHIFTw_cRIGHTDELETINGTRAILING'0'.也能实现去掉后置0
附:ABAP关于取整与取小数等数学函数
任意类型参数————————————F类型参数
ABS绝对值COS、SIN、TAN三角
SIGN正数为1,0为0,负为-1ACOS、。。。。。。。。反三角
TRUNC取得整数部分COSH、SINH、TANH双曲函数
FRAC取得小数部分EXP底数为E
CEIL取得不小于输入参数的最小整数LOG底数为10
FLOOR取得大小于输入参数的最小整数LOG10SQRT(平方根)
相关推荐
Cocolada 2020-11-12
82550698 2020-11-09
mnm0 2020-11-08
gaobudong 2020-11-04
匆匆那些年 2020-10-15
wangdianyong 2020-07-23
webpackvuees 2020-07-23
锋锋 2020-07-14
xlb 2020-07-12
liuttorrie 2020-07-04
XiaoMuFireAnt 2020-06-18
kekeromer 2020-05-07
数据齿轮 2020-03-03
Lophole 2020-03-03
YukiRain 2020-03-01
liuyang000 2020-01-06
zhegechengxuyuan 2019-11-16
woxmh 2019-11-09
bloomrose 2019-11-08