What MySQL type is most suitable for "price" column?

I have a price column in products table.

I wonder which MySQL type is the most suitable for this column. Is it DECIMAL, FLOAT, or something else ?

The price can be for example: 139.99, 40, 14.5 (2 digits after the decimal point, like in shops).

Please advise.


DECIMAL beacuse decimal value is stored precisely. E.g. DECIMAL(10, 2) will suit perfectly for prices not higher than 99999999,99. MySQL Docs reference


Field type "Decimal" will work best. Like:

`product_price` decimal(8, 2) NOT NULL,

It will store a price up to 999999.99

If you have high prices then you can use

`product_price` decimal(12, 2) NOT NULL,

i.e. up to 9999999999.99


You should certainly use a decimal type for money. Never floating point, contrary to other answers. And using varchar prevents you doing calculations.