Reputation: 76
I.m storing the value 123456789.00 in an SQL column of float
type, but when I'm retrieving it, the result set gives returns 1.23456789E8. I want it to retrieved the value exactly like stored, i.e. 123456789.00.
Upvotes: 1
Views: 1943
Reputation: 1
I'm not sure but I think 123456789.00 is too big number to store into a MySQL float
type. You need to reformat when you retrieve the value, or change the type (to a double
or varchar
, for example).
Upvotes: 0
Reputation: 6254
You can always store it as VARCHAR
and when you retrieve it, convert it into double.
Upvotes: 0
Reputation: 21961
If you want store floating point value with precision than mysql column type should be DECIMAL(size, precision)
. Here maximum size is 64. So, use DECIMAL
instead of float
.
Upvotes: 2
Reputation: 317
You can use following query for retrieving value
SELECT FORMAT(Column_Name,2) FROM TableName
Upvotes: 0