Good! That was a rather peculiar result, wasn't it? Let's see how we can fix it.
What kind of data is most important for every business? Money, of course. Because of rounding errors, floating point numbers are not suitable to store money values. After all, we don't want the bank to think that we ALMOST or NEARLY paid back the credit!
Money values can be stored in another data type:
DECIMAL. What is unique about this data type is that it stores numbers in the decimal system.
DECIMAL values are precise when they are added or divided by integer numbers. This is why they are an excellent choice for financial operations like calculating tax.
DECIMAL(p,s) takes two numbers: p is the precision (that is, the number of digits in the number) and s stands for the scale (the number of digits after the decimal point).
DECIMAL(5,2) is a number which has 5 digits, of which 2 are after the decimal point.