Question:
Dear Guru,
My problem is I have called a function and it return value in type F as 9.8519999999E-01
something like this.
I'd like to convert to value x.xxxx with truncate.
The result should be 0.9851, how should I do ?
Thanks in advance for all idea.
Answer:
DATA var TYPE P DECIMALS 4.
Answer:
That will return 0.9852 but I need 0.9851.
Any one has any other idea ?
Answer:
If I may ask a question - why on earth do you want 9.8519999999E-01 to become 0.9851? It makes no sense to me, business or mathematical - I'd be glad to be enlightened.
DATA fvar TYPE f VALUE '9.8519999999E-01'.
DATA pvar TYPE p DECIMALS 4.
pvar = floor( fvar * 10000 ) / 10000.
m@t
_________________
TULY The quality of answers is roughly proportional to the quality of the question.
The downside of being better than everyone else is that people tend to assume you're pretentious.