05-28-2008 12:34 PM
Hi all,
I need to Round off Only decimals in a Value
Eg:- 4715987.247898
So the result required is
4715987.25
can anyone suggest any technique or Function Module.
Regards,
AJ
05-28-2008 1:24 PM
hi anurag,
declare a variable of type p decimals 2 then pass the value.
ex.
constant: v_val1 type p decimals 6 value '4715987.247898'.
data: v_val2 type p decimals 2.
v_val2 = v_val1.
regards,
Peter
05-28-2008 12:35 PM
05-28-2008 12:35 PM
hi
use write statemnt addition
data f1 type p decimals 7 value '4715987.247898'.
write f1 DECIMALS 2 .
reward if helpful
prasanth
05-28-2008 12:37 PM
05-28-2008 12:37 PM
Hi,
Use function module ROUND.
or
MOve this value to a variable of type p decimals 2.
data: v_dec type p decimals 2.
v_dec = v_char.
Regards,
Raj.
05-28-2008 12:46 PM
Hi,
You can a declare a variable of p with decimals 2.
OR
type wrbtr.
Thanks,
Sriram Ponna.
05-28-2008 1:16 PM
Hi,
Declare one variable with datatype as P with decimals place 2. Then assign your input number to that variable and it automatically round-off to the 2 decimal places.
But note that the input number format is "4715987,247898" and not as you given "4715987.247898".
If you want to given as your wish then you need change the user settings.
Regards,
Raghu
05-28-2008 1:24 PM
hi anurag,
declare a variable of type p decimals 2 then pass the value.
ex.
constant: v_val1 type p decimals 6 value '4715987.247898'.
data: v_val2 type p decimals 2.
v_val2 = v_val1.
regards,
Peter