cbmstr
Programmer
- Feb 9, 2009
- 4
Hello,
i have some problem with compute with decimal places. I have an amount without a decimal places and a field as minor unit code, where are the number of decimal places.
The compute below doesn´t work, if the minor unit code are greater than 6.
decimal = PIC 9(39V(9)6 COMP-4.
COMPUTE decimal = amount * (10 ** (dcml * -1))
With a floating-point i get the proper value
COMPUTE decimal = amount * (10 ** (dcml * -1)) + 0.0E+00
Can somebody explain that or rather make proposal for a better way ?
Regards
Bernd
i have some problem with compute with decimal places. I have an amount without a decimal places and a field as minor unit code, where are the number of decimal places.
The compute below doesn´t work, if the minor unit code are greater than 6.
decimal = PIC 9(39V(9)6 COMP-4.
COMPUTE decimal = amount * (10 ** (dcml * -1))
With a floating-point i get the proper value
COMPUTE decimal = amount * (10 ** (dcml * -1)) + 0.0E+00
Can somebody explain that or rather make proposal for a better way ?
Regards
Bernd