Mokus
Mokus

Reputation: 10400

Doubles in MySQL

I created a table, which are contains some double, but when I added this number

7.341270020834490e+005

and the database is the following number:

734127.002083

cutting out some useful information. I want the hole number not just part of that

like:

734127.0020834490

Upvotes: 1

Views: 641

Answers (2)

Gaurav
Gaurav

Reputation: 28755

MySQL permits a nonstandard syntax: FLOAT(M,D) or REAL(M,D) or DOUBLE PRECISION(M,D). Here, “(M,D)” means than values can be stored with up to M digits in total, of which D digits may be after the decimal point.

See the manual

Upvotes: 3

koool
koool

Reputation: 15517

You can store this as a string in your database.... and when you want to use the value just use some method in the language that you are using to convert string to double.

Upvotes: 0

Related Questions