FLOAT(b) specifies a floating-point number with binary precision b. The precision b can range from 1 to 126. To convert from binary to decimal precision, multiply b by 0.30103. To convert from decimal to binary precision, multiply the decimal precision by 3.32193. The maximum of 126 digits of binary precision is roughly equivalent to 38 digits of decimal precision. 我试了一下,要float(10)才能显示出小数后两位。SQL> alter table test modify price float(10);表已更改。SQL> insert into test values(75.82);已创建 1 行。SQL> select * from test; PRICE ---------- 75.82
float(10)SQL> insert into test values(1011.11);已创建 1 行。SQL> select * from test; PRICE ---------- 1011所以,如果你的price很大,float(?)还要更大。
precision b can range from 1 to 126. To convert from binary to
decimal precision, multiply b by 0.30103. To convert from decimal
to binary precision, multiply the decimal precision by 3.32193.
The maximum of 126 digits of binary precision is roughly
equivalent to 38 digits of decimal precision.
我试了一下,要float(10)才能显示出小数后两位。SQL> alter table test modify price float(10);表已更改。SQL> insert into test values(75.82);已创建 1 行。SQL> select * from test; PRICE
----------
75.82
----------
1011所以,如果你的price很大,float(?)还要更大。