+ 1

Difference float and double

As the title, I want to know the difference to set float or double to a column in a table. Thank you

25th Apr 2018, 7:36 PM
Alberto Cini - Noviia
Alberto Cini - Noviia - avatar
3 Respuestas
+ 2
I understand thx stefano. Float has 2 decimals, but it can be stored without zero
25th Apr 2018, 8:22 PM
Alberto Cini - Noviia
Alberto Cini - Noviia - avatar
+ 1
We have a table like this : +-------+-------------+ | Field | Type | +-------+-------------+ | fla | float | | flb | float | | dba | double(10,2)| | dbb | double(10,2)| +-------+-------------+ For first difference, we try to insert a record with '1.2' to each field : INSERT INTO `test` values (1.2,1.2,1.2,1.2); The table showing like this : SELECT * FROM `test`; +------+------+------+------+ | fla | flb | dba | dbb | +------+------+------+------+ | 1.2 | 1.2 | 1.20 | 1.20 | +------+------+------+------+
25th Apr 2018, 8:20 PM
Alberto Cini - Noviia
Alberto Cini - Noviia - avatar