声明浮点变量时,我不明白 RPG 中存储对象所需的精度?
在我的练习中,我输入了份数,例如值5
。
总金额为0.50欧元,但我有类似的消息:
我不明白如何以total
双精度正确声明变量。
H
D NumberCopy S 3S 0
D Total S ???
*
/Free
dsply 'Enter your copy number please : ' '' NumberCopy;
If (NumberCopy < 11);
Total = NumberCopy * 0.10;
ElseIf (NumberCopy < 31);
Total = (10 * 0.10) + (NumberCopy - 10) * 0.09;
Else;
Total = (10 * 0.10) + (20 * 0.09) + (NumberCopy - 30) * 0.08;
EndIf;
dsply ('The amount is of …
Run Code Online (Sandbox Code Playgroud)