Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INT MS MYSQL DataTypes

Status
Not open for further replies.

d2g

Programmer
Apr 10, 2005
32
I'm trying to get a grasp on mysql data types.

have this number

1234567.8900

What do i set mysql column too in order to store this number.

Using INT(11) this number is stored as 1.23456e+06 and is pulled out in my script as 1234570.00

thanks in advance!

D2G
 
For a floating-point value, you could use either DOUBLE (8 bytes, range approx ±2e±308) or FLOAT (4 bytes, range approx ±2e±38). If it's fixed decimal places, you could either use DECIMAL(width,precision), though this is quite inefficient, or store the digits as an integer type like BIGINT (8 bytes), multiplying by 10000 before storage, and dividing again after retrieval.
 
i meant 1234567.8901 above.. I need to be able to store this number in the column as is.

Thanks!

 
thanks ill check into the above and run some tests.

thanks!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top