2008 Aug 04 5:54 PM
hi,
i went thru the forum for this and tried but did not work out..
my requirement is to round off a decimal number to zero decimals. so if the value is 1.3456 it should be 1.00 and if it is 1.8767 then it should be 2.00.
i used the ROUND FM, no help..anything else is can do ?
i am trying to set this rounded number in my dialog screen text element whose data type is set as INIT1.
do i need to change anything ?? pl suggest.
thks
2008 Aug 04 5:56 PM
Just move the content to TYPE I field.
Like:
DATA: P_VAL TYPE P DECIMALS 3 VALUE '1.887',
P_INT TYPE I.
P_INT = P_VAL.
P_VAL = P_INT.
WRITE: P_VAL.
Regards,
Naimesh Patel
2008 Aug 04 5:56 PM
Just move the content to TYPE I field.
Like:
DATA: P_VAL TYPE P DECIMALS 3 VALUE '1.887',
P_INT TYPE I.
P_INT = P_VAL.
P_VAL = P_INT.
WRITE: P_VAL.
Regards,
Naimesh Patel
2008 Aug 04 6:08 PM
2008 Aug 04 6:55 PM
Hi Friend,
You can use the function module:
J_1I6_ROUND_TO_NEAREST_AMT
CALL FUNCTION 'J_1I6_ROUND_TO_NEAREST_AMT'
EXPORTING I_AMOUNT = V_KWERT u201C Amount to convert*
I_AMOUNT1 =
I_AMOUNT2 =
I_AMOUNT3 =
I_AMOUNT4 = ...
Regards,
Chandra Sekhar
2008 Aug 04 7:01 PM
Hi,
you can do this by declaring one more variable of type INT. and then pass the value with decimal to this type.
for e.g
type_p = 12.224.
type_i = type_p . it will store 12
type_p = type_i.
it will store 12.00.
*Please reward if you find the answer useful.
Thanks,
Kamesh