I have many float columns, But in phpmyadmin I didn't provide the size of float but unlike varchar, it still saves the column
what is the default size of float?
should I enter the size manually like Float(10,2) Or it does not make much performance difference ?
Thanks :)
As mysql manual on float says:
For maximum portability, code requiring storage of approximate numeric data values should use FLOAT or DOUBLE PRECISION with no specification of precision or number of digits.
No length is the default length value.
However, if you do specify length, then mysql will round the float to the number of decimals specified. See the documentation linked above for more details:
For example, a column defined as FLOAT(7,4) will look like -999.9999 when displayed. MySQL performs rounding when storing values, so if you insert 999.00009 into a FLOAT(7,4) column, the approximate result is 999.0001.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With