09-08-2008 6:47 AM
HI experts.
Can anyone explain to me how to use the floor statement.
Thank you in advanced.
Edited by: Julius Bussche on Sep 8, 2008 7:16 AM
09-08-2008 6:50 AM
hi,
Floor statement gives you the greatest integer value of a float quantity.
syntax
DATA A TYPE P DECIMALS 2.
DATA B TYPE P DECIMALS 2 VALUE '-5.55'.
A = FLOOR( B ). WRITE: / 'FLOOR:', N.
Result :
FLOOR:-6.00
and
DATA A TYPE P DECIMALS 2.
DATA B TYPE P DECIMALS 2 VALUE '5.55'.
A = FLOOR( B ). WRITE: / 'FLOOR:', N.
Result :
FLOOR: 5.00
Regards,
Anirban
09-08-2008 6:50 AM
hi,
Floor statement gives you the greatest integer value of a float quantity.
syntax
DATA A TYPE P DECIMALS 2.
DATA B TYPE P DECIMALS 2 VALUE '-5.55'.
A = FLOOR( B ). WRITE: / 'FLOOR:', N.
Result :
FLOOR:-6.00
and
DATA A TYPE P DECIMALS 2.
DATA B TYPE P DECIMALS 2 VALUE '5.55'.
A = FLOOR( B ). WRITE: / 'FLOOR:', N.
Result :
FLOOR: 5.00
Regards,
Anirban
09-08-2008 6:53 AM
Hi,
Check this thread,
http://www.geocities.com/rmtiwari/Resources/Utilities/ABAPReference/ABAPReference.html
Regards
Guru
09-08-2008 6:53 AM
Hi,
I hope the following link will help you,
DATA : n TYPE p DECIMALS 3.
DATA : m TYPE p DECIMALS 3 VALUE '3.44'.
n = floor( m ).
DATA : Q(10) TYPE C.
Q = N.
WRITE:/ Q.
Regards,
Harish
09-08-2008 6:58 AM
Hi,
Floor always adjust the given floating value to its..lowest integer value...
for ex...if n = 33.75 then it will adjust the value n to 33.00.
where as Ceil to its upper value..
check this
data ant(5) type p DECIMALS 2 value '33.75'.
ant = floor( ant ) .
write ant.