REPORT z_barry_test .
DATA: p TYPE p DECIMALS 4 ,
str(16) TYPE c .
p = '-232323.2'.
IF p < 0 .
p = - p.
WRITE p TO str.
CONDENSE str.
CONCATENATE '-' str INTO str.
p = - p.
ELSE.
WRITE p TO str.
ENDIF.
WRITE str.
——————
REPORT z_barry_test2.
DATA: p TYPE p DECIMALS 4 ,
str(16) TYPE c .
p = '-232323.2'.
WRITE p TO str.
IF p < 0 .
SHIFT str BY 1 PLACES RIGHT CIRCULAR.
CONDENSE str NO-GAPS.
ENDIF.
WRITE str.
如果需要控制Write出来的数值的后面零的数量,参考:
阅读(6343) | 评论(1) | 转发(1) |