What is the best field type for the price in MySQL and PostgreSQL due the date?
[any number]
.[always two digits, except when value is 0]
What is the best field type for the price in MySQL and PostgreSQL due the date?
[any number]
.[always two digits, except when value is 0]
DECIMAL
in both, and no, this is not an "opinion-based question". :)
https://dev.mysql.com/doc/refman/5.1/en/precision-math.html
http://www.postgresql.org/docs/9.3/static/datatype-numeric.html - see arbitrary precision types
I would use something like NUMERIC(15,2) for MySQL and the built-in MONEY data type in PostgreSQL.