Question How to store 123456789.12345678901 decimal value to the decimal field?

vignesh

New Member
Hello All,

Progress Version: 10.2B

How to store 123456789.12345678901 decimal value to the decimal field?

define variable l_dec like xx_dec format "999999999.99999999999" no-undo.

l_dec = 123456789.12345678901.

for each xx_mstr exclusive-lock:
xx_dec = l_dec.
end.

Thanks in advance.
 

Cringer

ProgressTalk.com Moderator
Staff member
It would help if you described your problem more accurately. I've had a bit of a play and it looks like the last 2 digits are lost. Is that your problem?
 

Cringer

ProgressTalk.com Moderator
Staff member
And to be fair, why would you want to? 2 significant digits put man on the moon IIRC.
 

TomBascom

Curmudgeon
If you really need more than 10 digits of precision (maybe you're calculating pi?) you will need to "bias" your numbers by first multiplying by some power of 10 before you perform your calculations. For instance, if you multiply everything by 1,000 you shift the decimal three places to the right... then use the string() function and some fancy footwork to shift the positioning of the decimal for output purposes. Of course the total number of digits is still restricted to 50 -- so you now only have 37 digits of integer info available ;)
 
Top