Oracle Online Help 说: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 binary to decimal precision, multiply b by 0.30103。"float(10) --> INT(10*0.30103) = 3 221347.99 --> 2.213 * 10 ^ 5 = 221300 0.99 --> 0.990 * 10 ^0 = 0.99
--参考一下:SQL> create table ttt(iid number(15,2));Table createdSQL> insert into ttt values(221347.99);1 row insertedSQL> commit;Commit completeSQL> select * from ttt; IID
-----------------
221347.99SQL>
--可以考虑用NUMBER型:
SQL> SET SERVEROUTPUT ON
SQL> CREATE TABLE TEST_TTT (FIELD1 NUMBER(10,2));Table createdSQL> INSERT INTO TEST_TTT VALUES(221347.99);1 row insertedSQL> COMMIT;Commit completeSQL> SELECT * FROM TEST_TTT; FIELD1
------------
221347.99SQL> INSERT INTO TEST_TTT VALUES(22134768.99);1 row insertedSQL> COMMIT;Commit completeSQL> SELECT * FROM TEST_TTT; FIELD1
------------
221347.99
22134768.99
float主要用来浮点计算,还是使用number来定义吧。
也有可能是cpu的问题我建议你用数据类型numeric代码float
221347.99 --> 2.213 * 10 ^ 5 = 221300
0.99 --> 0.990 * 10 ^0 = 0.99