Avoid the FLOAT type for database columns

Updated . Posted . Visible to the public. Repeats.

Like in any language, a FLOAT has complicated semantics for precision. This sometimes causes stored numbers to be slightly off their original value.

Please consider using DECIMAL instead. Decimals have well-defined behavior for rounding and range overflows.

Profile picture of Henning Koch
Henning Koch
Last edit
Henning Koch
Keywords
mysql, postgresql, anysql
License
Source code in this card is licensed under the MIT License.
Posted by Henning Koch to makandra dev (2014-02-24 11:51)