我已经输出了9(13).9(02)==000000000000000.00
我需要将其设置为13个空格。2个空间。请帮助实现。
注意:i tried "当0 "我尝试定义"3"个字母数字值,然后移动"3"。还是老样子
请帮助。
提前感谢!!
output-field
将包含符合pic
的格式化值,或者包含13个空格,一个小数点,当值为零时包含2个空格。
代码:
data division.
working-storage section.
01 field-with-value pic s9(9)v99 value zero.
01 output-field value space.
88 output-custom-field value " . ".
02 formatted-field pic 9(13).9(02).
procedure division.
move +1 to field-with-value
perform display-output-field
move zero to field-with-value
perform display-output-field
stop run
.
display-output-field.
if field-with-value = zero
set output-custom-field to true
else
move field-with-value to formatted-field
end-if
display quote output-field quote
.
输出:
"0000000000001.00"
" . "