cancel
Showing results for 
Search instead for 
Did you mean: 

scientific notation to Decimal

10-08-2020 3:10 PM
3696 views 5 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Hi Experts,

I used to get Scientic format numbers in CSV file and I wanted to convert Scientific to Decimals 17,3.

Every time we used to get CSV file with scientific format numbers.

All of the numbers are in the column in scientific notation eg 2.8873322531580925E-2 .

Any idea how to solve this issue, please let me know.

Regards, Rag

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

Julian_Riegel
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi there,

have a look at this post - it should help you solve this by building a custom function:

http://bodataservices.blogspot.com/2011/09/scientific-notation.html

if (index($VarcharNumber,'E',1) IS NULL)
begin
Return to_decimal_ext($VarcharNumber,'.',',',38,12);
end
else
begin
Return to_decimal_ext(word_ext($VarcharNumber,1,'E'),'.',',',38,24) * power(10, to_decimal_ext(word_ext($VarcharNumber,2,'E'),'.',',',38,12));
end

Regards,

Julian

Former Member
0 Likes

Hi Julian,

Thanks for your response....

I have tried for Custom Function as you mentioned but the data is not deriving as expected.

Regards,

Rag

Julian_Riegel
Product and Topic Expert
Product and Topic Expert
0 Likes

If your Input is 8.07E+05 the correct decimal conversion is 807000.000 - this is also what the above custom function generates.

I have quickly tested it with said input:

Also, if I put in your original Number 806893.689986282, the output is correct:

I'm not sure if I then understand your requirement correctly, but I would assume you have to adapt your source input as

8.07E+05 != 806893.689986282 - you would never get back the original value, rounding already seems to take place in your source.

Regards,

Julian

Former Member
0 Likes

Hi Julian,

Thanks for your valuable inputs and I was working fine.

Appreciated your help on this

Regards,

Rag

Answers (0)