05-25-2006 12:12 PM
Dear All,
I need to carry all the calculations to the fourth decimal place.
When the calculation value is more than 0.00005 than round up to the next 0.0001 (to the next fourth decimal place value). Otherwise, round down to the next 0.0001 (to the next forth decimal place value).
Will you kindly provide me some code for this?
Thanks in Advance,
KCRanjan
05-25-2006 12:21 PM
hi,
chk this
REPORT ychatest .
data : p_amy type p decimals 4.
p_amy = '123.13567'.
write : p_amy.
05-25-2006 12:14 PM
Hii
You can declare the variable type P decimals 4.
Move this value to a variable of type p decimals 4.
<b>data: v_round type p decimals 4.
v_round = v_dec.
write:/v_round
</b>
otherwise
use FM 'ROUND'.
or
'HR_IN_ROUND_AMT' .
regards
Naresh
05-25-2006 12:15 PM
Hi,
declare the variable whatever is storing that decimal value as type p decimal4.
Regards,
Aswin
05-25-2006 12:16 PM
hi
data : num1 type p decimals 5,
num2 type p decimals 5,
sum num type p decimals 5.
sum = num1 + num2.
05-25-2006 12:16 PM
05-25-2006 12:16 PM
Try this..
data: p type p decimals 5 value '123456.00005'.
write:/ p decimals 4 .
05-25-2006 12:21 PM
hi,
chk this
REPORT ychatest .
data : p_amy type p decimals 4.
p_amy = '123.13567'.
write : p_amy.
05-25-2006 12:32 PM
Hi ,
You can use the FM
<b>HR_IN_ROUND_AMT</b> for achieving your requirement.
Regards,
SP.