‎2006 Nov 29 5:58 AM
Hi,
Is there any function module in SAP for rounding of the numbers e.g if 100.91 is passed it should show 101.00.
Thanks in advance
Arvind
‎2006 Nov 29 5:58 AM
hi,
use
ceil
eg:
lold = 99.8.
lnew = ceil( lold ).
write lnew.
rgds
Anver
‎2006 Nov 29 6:06 AM
‎2006 Nov 29 6:08 AM
hi,
DATA: ws_data TYPE p VALUE '9.90',
ws_data1 TYPE p.
ws_data1 = CEIL( ws_data ).
WRITE ws_data1.rgds
Anver
‎2006 Nov 29 6:09 AM
CEIL itself is teh syntax
VAR1 = CEIL(VAR).
wat a CEIL does is - it gives the smallest integer number that is not smaller than the value of the argument arg.
Regards
- Gopi
‎2006 Nov 29 6:04 AM
Hi,
DATA n TYPE p DECIMALS 2.
DATA m TYPE p DECIMALS 2 VALUE '-5.55'.
n = ceil( m ). WRITE: / 'CEIL: ', n.
The output appears as follows:
CEIL: 5.00-
‎2006 Nov 29 6:32 AM
Hi,
DATA n TYPE p DECIMALS 2.
DATA m TYPE p DECIMALS 2 VALUE '5.25'.
n = ceil( m ). WRITE: / 'CEIL: ', n.
and the output is shown as ' 6.00' but it should be '5.00'.
Please let me know if any other method is there .
‎2006 Nov 29 6:38 AM
Hi,
It will return the lowest value.SInce 5 is less than 6,output is 5.
If you use floor ( 5.25 ),that will return you 6.But that will be the output even if you give floor (5.75).
You need to do manual programming.
Function
Result
abs
Absolute value of argument.
sign
Prefix of the argument : 1 x > 0
SIGN( x ) = 0 if x = 0
-1 x < 0
ceil
Smallest integer value not smaller than the argument.
floor
Largest integer value not larger than the argument.
trunc
Integer part of argument.
FRAC
Fraction part of argument.
‎2006 Nov 29 6:41 AM
hi jayathi,
a small correction in ur post.
floor -> give the lower round value.
5.5 -> 5
ciel -> give the highr rounded value.
5.5 -> 6.
keep doing the helps
rgds
Anver.
‎2006 Nov 29 6:08 AM
Hi
use abs r ceil
check this example...
DATA: I TYPE I,
P TYPE P DECIMALS 2,
M TYPE F VALUE '-3.5',
D TYPE P DECIMALS 1.
P = ABS( M ). " 3,5
I = P. " 4 - business rounding
I = M. " -4
I = CEIL( P ). " 4 - next largest whole number
I = CEIL( M ). " -3
I = FLOOR( P ). " 3 - next smallest whole number
I = FLOOR( M ). " -4
I = TRUNC( P ). " 3 - integer part
I = TRUNC( M ). " -3
D = FRAC( P ). " 0.5 - decimal part
D = FRAC( M ). " -0.5
check this link
-charitha