What's the proper field type for numbers in MySQL?
I have a field with numbers like 0.00, 4.12, 99.10, 130.99
So TINYINT or SMALLINT are not valid since they remove the decimal places to 0, 4, 131 etc.
When I cose VARCHAR I cannot properly ORDER BY because it sorts 99.10 after 130.99
Which type do I need? Highest number will not be larger than 1000.
Column syntax:
`name` DECIMAL(<precision>,<scale>)
Note that <precision>
is the total column length, so DECIMAL(5,2)
is 3 digits before the decimal and 2 after.