‎2009 Apr 26 7:02 AM
hi all,
i want to convert no like 1.200000000e2 into 0.012 here 1st no is of P data type how should i change it.
thanx.
‎2009 Apr 26 7:12 AM
Data: W_num type p decimals 3.
W_num = '1.200000000e2'.This will resolve the issue..
regards,
Gurpreet
‎2009 Apr 26 7:12 AM
Data: W_num type p decimals 3.
W_num = '1.200000000e2'.This will resolve the issue..
regards,
Gurpreet
‎2009 Apr 26 8:29 AM
Defining the type as packed and giving the decimal precision will help you.
Regards,
Lalit Mohan Gupta.
‎2009 Apr 26 10:35 AM
Hi,
Define a variable with decimal 3.
Then move ur value to the new variable.
DATA : W_NEW TYPE P DECIMALC 3.
WRITE W_OLD TO W_NEW DECIMALS 3.
Here W_OLD is your Exponential Value.
‎2009 Apr 27 3:14 AM
Hi Bhupi,
How about making 100% your own cutom coding.
I am not sure about your full req. but i have written a sample code for you just look at that.
DATA : A1(15), B1(15), C1, D1(10) TYPE P DECIMALS 3, E1(6).
*Move your current value to a Character variable.
A1 = '1.200000000e2'.
SPLIT A1 AT 'e' INTO B1 C1.
Split your value accordingly
*Calculate the multiplication factor you can take upto 10000000000000. depending on your Requirement
IF C1 EQ 1.
E1 = 10.
ELSEIF C1 EQ 2.
E1 = 100.
ELSEIF C1 EQ 3.
E1 = 1000.
ELSEIF C1 EQ 4.
E1 = 10000.
ELSEIF C1 EQ 5.
E1 = 100000.
ELSEIF C1 EQ 6.
E1 = 1000000.
ENDIF.
*Your fiunal value
D1 = B1 / E1.
Thanks & Regards,
Dileep .C