‎2008 May 23 10:08 AM
Hi Expert,
Here i displayed age in decimals. But i want round figure. like if it is 0.5 or 0.6 it is rounded as 1 and if it is 1.4 rounded as 1.5 like that.
How can i wil do
Thanks
‎2008 May 23 10:34 AM
If your requirement is to round to the nearest integer, declare a variable of type Integer and move the decimal value to integer variable. This will get you the rounded integer value.
You can try with below example code:
PARAMETERS: p_dec TYPE netwr.
DATA: p_num TYPE i.
p_num = p_dec.
write:/ p_num.
‎2008 May 23 12:09 PM
Hi,
Try this code....
code
report zrich_0001 .
data: c(20) type c,
p1(10) type p decimals 1,
p2(10) type p decimals 2.
c = '22354.22'.
p1 = c.
p2 = p1.
Write 😕 p2.
[/code]
There is a ABAP statement ROUND.
Check this link for details and examples.
http://help.sap.com/erp2005_ehp_03/helpdata/EN/9f/db9e3d35c111d1829f0000e829fbfe/frameset.htm
Regards,
Raj.