el_pup_le
el_pup_le

Reputation: 12179

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?

Upvotes: 1

Views: 173

Answers (2)

John Conde
John Conde

Reputation: 219824

DECIMAL. A lot of people use FLOAT but that is unecessary in most situations.

DECIMAL(3,1)

Upvotes: 6

Ricardo Altamirano
Ricardo Altamirano

Reputation: 15198

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

Upvotes: 3

Related Questions