使用C代码的Cobol输入掩码格式 [英] Cobol Input Mask format using C code
问题描述
如何?
Cobol的输入掩码格式类似于以下内容:
使用整数345
图片99999收益00345
图片zzzz9收益345
甚至zzzVzz收益率3.45
9zzzVzz无效(z左侧9)。
$ zzVzz浮动美元$ 3.45
>
整数1234567
图片$ zzzTzzzVzz
结果$ 12,345.67 >
V是非度量国家/地区的点数,并且
某些软件使用T来表示逗号。 T是逗号,在美国,和点。在公制国家。
是否已有例行程序执行此操作?类似
picformat(结果,图片,整数),
有一个符号规则(当整数为负时)。 S $ / $
$ SzzzTzzzVzz或$ zzzTzzzVzzS
$ -12,345.67 $ 12,345.67-
How to?
Cobol has an input mask format similar to the following:
Using integer 345
picture "99999" yields 00345
picture "zzzz9" yields 345
or even "zzzVzz" yields 3.45
"9zzzVzz" invalid (9 to the left of z).
"$zzVzz" floating dollar $3.45
integer 1234567
picture "$zzzTzzzVzz"
results in $12,345.67
V is dot in non metric countries, and
Some software uses the T to indicate comma. T is comma , in USA, and dot . in metric countries.
Is there already a routine that does this? something like
picformat(Result, Picture,integer),
There is a rule for sign (when integer was negative). S
$SzzzTzzzVzz or $zzzTzzzVzzS
$-12,345.67 $12,345.67-
推荐答案
zzVzz浮动美元
3.45
整数1234567
picture
3.45
integer 1234567
picture "
zzzTzzzVzz
结果
zzzTzzzVzz"
results in
这篇关于使用C代码的Cobol输入掩码格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!