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 (有效数位:从左边第一个不为0的数算起)
Value | Datatype | Stored Value |
123.2564 | NUMBER | 123.2564 |
1234.9876 | NUMBER(6,2) | 1234.99 |
12345.12345 | NUMBER(6,2) | Error |
1234.9876 | NUMBER(6) | 1235 |
12345.345 | NUMBER(5,-2) | 12300 |
1234567 | NUMBER(5,-2) | 1234600 |
12345678 | NUMBER(5,-2) | Error |
123456789 | NUMBER(5,-4) | 123460000 |
1234567890 | NUMBER(5,-4) | Error |
12345.58 | NUMBER(*, 1) | 12345.6 |
0.1 | NUMBER(4,5) | Error |
0.01234567 | NUMBER(4,5) | 0.01235 |
0.09999 | NUMBER(4,5) | 0.09999 |
0.099996 | NUMBER(4,5) | Error |