Mutley Posted June 16, 2008 Share Posted June 16, 2008 I've tried INT but it removes the decimal, I'm wanting to do a SQL query so when I order by that field it does like so: 12.4 12.1 11.3 9 5.4 5 4 But with a Varchar it puts the highest numbers with more than 1 digit at the bottom, same with char. Which is best to use? Quote Link to comment https://forums.phpfreaks.com/topic/110461-best-field-type-for-number-decimal/ Share on other sites More sharing options...
rhodesa Posted June 16, 2008 Share Posted June 16, 2008 i think you are looking for DECIMAL http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html Quote Link to comment https://forums.phpfreaks.com/topic/110461-best-field-type-for-number-decimal/#findComment-566714 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.