Since money needs an exact representation don’t use data types that are only approximate like float
. You can use a fixed-point numeric data type for that like
decimal(15,2)
15
is the precision (total length of value including decimal places)2
is the number of digits after decimal point
See MySQL Numeric Types:
These types are used when it is important to preserve exact precision, for example with monetary data.