1.通过移位删除前导0或后缀0.
代码语言:javascript复制data:
str type char10 value '0010000000'.
shift str left deleting leading '0'.
shift str right deleting trailing '0'.
2.通过内外书式去除前导0.
如:
功能模块'CONVERSION_EXIT_ALPHA_OUTPUT'.
3.通过数值变量转换也可以去除前导0.
代码语言:javascript复制data:
int type i,
str type char10 value '0010000000'.
int = str.
str = int.
DATA CV_INT TYPE INT4.
DATA CV_STR TYPE STRING.
CV_INT = '199.00666'.
CV_STR = CV_INT.
CONDENSE CV_STR."BREAK-POINT.
SHIFT CV_STR RIGHT DELETING TRAILING '0'.
CONDENSE CV_STR.
SHIFT CV_STR RIGHT DELETING TRAILING '.'.
CONDENSE CV_STR.
WRITE : CV_STR.