Jfisher446 Posted November 18, 2006 Share Posted November 18, 2006 I am trying to get prices imported into a table. I set the type as Integer but it is rounding up the decimals as opposed to including them. I read the mysql manual regarding numeric types and from what I can tell I need to change the precision of it but theres not an option for that so I simply think that I am reading the wrong sections and can't find what I need. How can I keep the decimals in the data? Also is there anyway when pulling the prices from the table to include commas (some data is in billions of dollars)?Thanks in advance Link to comment https://forums.phpfreaks.com/topic/27666-integer-type-in-mysql-not-allowing-decimals-how-do-i/ Share on other sites More sharing options...
Zane Posted November 18, 2006 Share Posted November 18, 2006 look at the datatypes FLOAT, DECIMAL, and DOUBLE Link to comment https://forums.phpfreaks.com/topic/27666-integer-type-in-mysql-not-allowing-decimals-how-do-i/#findComment-126528 Share on other sites More sharing options...
Barand Posted November 18, 2006 Share Posted November 18, 2006 As for the commas, do not store the numbers with commas in the db. Format on output.http://www.php.net/number_format Link to comment https://forums.phpfreaks.com/topic/27666-integer-type-in-mysql-not-allowing-decimals-how-do-i/#findComment-126573 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.