Welcome Guest | Login

How to convert Scientific value in Number

Hi there,

My csv file having some Scientific value and before importing into the db I want to convert those values in number.

Could you please help me out.

Thanks in Advance :)

~Deepak

2008-07-25 09:42 PM

Website
Blog

What type of scientific values are in your csv file? For eg:- The expression "E" ( 1.2E3 ) is a standard MySQL Scientific value. You can directly load the contents in the csv file to the MySQL db using the command "LOAD DATA INFILE".

2008-07-25 11:10 PM

Thanks Vinayan.

The format of scientific values is 2.60E+12

How to convert this in number before saving to db

Any help would be appreciated.

~Deepak

2008-07-25 11:14 PM

Website
Blog

To convert 2.60E+12 to number:

2.60E+12 = 2.60*10^12 which is equal to 2,600,000,000,000 .

2008-07-26 04:02 AM

that is fine. How to calculate this in Ruby? Is there any built-in function?

2008-07-28 03:50 AM

Website
Blog
Hi Dshivhare,

I am not sure about any inbuilt function in Ruby to convert scientific value to normal format. But you can convert one base to another base  Eg:- octal to decimal or binary to decimal etc. It seems like you can directly enter the value 2.60E+12 to your database. The expression "E" is a standard MySQL Scientific value and your database will recognize it. Do you face any issue since the value is in scientific format?

2008-07-28 08:54 AM


Hello Guest! In order to post you must be an active client with us, please log in or sign up today!