10-16-2008 9:19 AM
Hi experts,
I want to convert 16 decimal place into 4 decimal place in a floating-point value. Is there any Function module to do this? or any other way?
Thanks in advance.
With regards,
Goutam.
10-16-2008 9:22 AM
Hi,
TRy this code
DATA : VAL1 TYPE F VALUE '1.12345678912345678',
VAL2 TYPE P DECIMALS 4.
VAL2 = VAL1.
WRITE : VAL1,
VAL2.
Regards
10-16-2008 9:24 AM
hi,
Take another variable of TYPE P DECIMALS 1 and MOVE fltp to type p.
DATA V_FLTP TYPE F VALUE '4.650000000000000E+01'.
DATA V_PD TYPE P DECIMALS 1.
V_PD = V_FLTP
WRITE V_PD. -
> 46.5.
V_PD displays leading blanks and displays 46.5,BUT if you need with out leading blanks then take a character variable of length 16 and move the contents of V_PD.
DATA V_C(16) TYPE C.
V_C = V_PD.
CONDENSE V_C.
WRITE V_C. -
> 46.5 (W/0 leading blanks)
check the below links
regards
Satish
01-13-2009 6:59 AM