CyberShot Posted November 24, 2015 Share Posted November 24, 2015 I have a field called amount in my database. I have set it to "double" data type. I have entered data like so 10.80 when my query returns the results from the database, I get this 10.8 Do I need to append the extra zero or is there some other data type I should use? Quote Link to comment https://forums.phpfreaks.com/topic/299565-formatting-data/ Share on other sites More sharing options...
Solution Jacques1 Posted November 24, 2015 Solution Share Posted November 24, 2015 Simply format the number in your application when you display it. Or if you insist on a doing this with MySQL, use FORMAT() in your query. Quote Link to comment https://forums.phpfreaks.com/topic/299565-formatting-data/#findComment-1527021 Share on other sites More sharing options...
CyberShot Posted November 25, 2015 Author Share Posted November 25, 2015 Thank you Quote Link to comment https://forums.phpfreaks.com/topic/299565-formatting-data/#findComment-1527097 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.