10-07-2008 8:16 AM
hi friends
how to remove the zero after decimal points.
example :
123.450 -- if print only 123.45
45.600 - 45.6
any body help me.
thanks
pauldhama
10-07-2008 8:27 AM
hii
use FM
FTR_CORR_SWIFT_DELETE_ENDZERO
this FM will remove all the zeros from decimal values
like
value - 234.8000000
output - 234.8
regards
twinkal
10-07-2008 8:21 AM
hi..
Use..keyword: SHIFT
ex:
SHIFT varb1 RIGHT DELETING TRAILING '0'.
regards,
Padma
10-07-2008 8:26 AM
03-17-2021 6:54 AM
10-07-2008 8:23 AM
10-07-2008 8:29 AM
hi
i need only remove the zero after decimal points only.
decimal 0 -- this statement obmit the all decimals value.
10-07-2008 8:25 AM
Hi,
do this way
SHIFT VALUE LEFT DELETING LEADING '0'.
Thanks,
Chidanand
10-07-2008 8:27 AM
hii
use FM
FTR_CORR_SWIFT_DELETE_ENDZERO
this FM will remove all the zeros from decimal values
like
value - 234.8000000
output - 234.8
regards
twinkal
10-07-2008 8:30 AM
go through this example
it may help u
DATA: T(14) VALUE ' abcdefghij',
STRING LIKE T,
STR(6) VALUE 'ghijkl'.
STRING = T.
WRITE STRING.
SHIFT STRING LEFT DELETING LEADING SPACE (or use 0 to detete 0).
WRITE / STRING.
STRING = T.
SHIFT STRING RIGHT DELETING TRAILING STR or 0.
WRITE / STRING.
Output:
abcdefghij
abcdefghij
abcdef
10-07-2008 8:30 AM
10-07-2008 9:18 AM
Hello
Try this logic:
data: var1 type p decimals 3,
var2 type p decimals 2,
var3 type p decimals 1.
move '12345.100' to var1.
move var1 to var2.
move var1 to var3.
if var2 = var1.
if var3 = var1.
write var3.
else.
write var2.
endif.
else.
write var1.
endif.
10-07-2008 9:20 AM
hi,
i think this is the corect way..
FM.
FTR_CORR_SWIFT_DELETE_ENDZERO
but we can not how many zero will be at last...
Regards,
Bharani
10-10-2008 2:16 PM
Hello
Tryt his code :
data amt(6) type p decimals 3 value '123.450'.
data amt1(6) type p decimals 2.
data amt_c(6) type c.
unpack amt to amt_c.
shift amt_c right deleting trailing '0'.
pack amt_c to amt1.
write amt1.
regards,
Advait
Edited by: Advait Gode on Oct 10, 2008 3:16 PM