Browsed by
Tag: decimal precision

MySQL Float vs. Decimal Money Datatype

MySQL Float vs. Decimal Money Datatype

It is surprising how often I see confusion around the MySQL float and decimal data types – especially when it comes to deciding which one to use when storing financial figures. Let’s compare the float and decimal definitions, and then compare the two in real use. From the MySQL documentation: Float: A small (single-precision) floating-point number. Allowable values are -3.402823466E+38 to -1.175494351E-38, 0, and 1.175494351E-38 to 3.402823466E+38. These are the theoretical limits, based on the IEEE standard. The actual range…

Read More Read More