I created a table in MySQL with a column of type float(2,2) and inserted value 10 into the same, but I found that the value stored is 0.99.
What is the reason behind this ? If we use a column of type float(m, n) in MySQL where ‘m’ and ‘n’ are integers, then what should I watch out for when storing values in this column ?
float(2,2)means “use two digits, of which two are used after the decimal point”.Hence, you can go from -0.99 to 0.99. You can’t insert 10 into this column, you’d need atleast two digits before the comma (so float(4,2) or float(2,0)).