效数位:从左边第一个不为0的数算起
原文参考:
http://blog.itpub.net/post/26/3796
number(p,s)
p:1~38
s:-84~127
p>0,对s分2种情况:
1. s>0
精确到小数点右边s位,并四舍五入。然后检验有效数位是否<=p;如果s>p,小数点右边至少有s-p个0填充。
2. s<0
精确到小数点左边s位,并四舍五入。然后检验有效数位是否<=p+|s|
比如:
代码:Value Datatype Stored Value 123.2564 NUMBER 123.25641234.9876 NUMBER(6,2) 1234.9912345.12345 NUMBER(6,2) Error1234.9876 NUMBER(6) 123512345.345 NUMBER(5,-2) 123001234567 NUMBER(5,-2) 123460012345678 NUMBER(5,-2) Error123456789 NUMBER(5,-4) 1234600001234567890 NUMBER(5,-4) Error12345.58 NUMBER(*, 1) 12345.60.1 NUMBER(4,5) Error0.01234567 NUMBER(4,5) 0.012350.09999 NUMBER(4,5) 0.099990.099996 NUMBER(4,5) <>