Search code examples
mysqlsqldatabasesqldatatypes

Specifying float size for 00.0


Considering I know the range of a field (0 - 10) and I only need to keep precision to one decimal place 00.0, what is the best field type for this column?


Solution

  • The data type you want is DECIMAL(3, 1). Per the documentation, this will store any value from -99.9 to 99.9.