‎2008 Jun 24 6:55 AM
Hi All,
I want to divide the Currency value by decimal value.
When i try to it, it returns the rounded value and not the exact value.
For ex:
data: sal like pa0008-bet01 value '50570.06',
amnt type decimals 2 value '57462.23',
ans TYPE p LENGTH 11 DECIMALS 2.
ans = ( sal / amnt ) * 100.
write:/ ans.
It returns 0.01 and it should be 88.01
Thanx in advance
‎2008 Jun 24 7:09 AM
Hi
The following code it returns 88.01
data: sal like pa0008-bet01 value '50570.06',
amnt type p decimals 2 value '57462.23',
ans type p decimals 2.
ans = ( sal / amnt ) * 100.
write:/ ans.
Just execute the above code.
Regards
Raja.
‎2008 Jun 24 7:11 AM
Hii ..check with the amount declaration
amnt type p LENGTH 8 decimals 2 value '57462.23'
Rgds,
‎2008 Jun 24 7:16 AM
‎2008 Jun 24 7:17 AM
Hi,
In your code change this
amnt type decimals 2 value '57462.23',
to amnt type p decimals 2 value '57462.23',
it will work out.
‎2008 Jun 24 7:19 AM
Hi,
Jus try this...
data: sal like pa0008-bet01 value '50570.06',
amnt type p decimals 2 value '57462.23',
ans TYPE p LENGTH 11 DECIMALS 2.
ans = ( sal / amnt ) * 100.
write:/ ans.