NUMBER Type Details:
Oracle number datatype Syntax: NUMBER [(precision [, scale])]
Short for: precision --> p
Scale --> s
NUMBER (p, s)
Range: 1 <= p <= 38,-84 <= s <= 127
Data storage range:-1.0e-130 <= number value <1.0e + 126
Saved in the machine range: 1 ~ 22 bytes
Valid: the number of digits from the first digit not 0 on the left.
S:
S> 0
Accurate to the second place to the right of the decimal point, and rounded. Then, check whether the valid bit is <= p.
S <0
It is accurate to the second place on the left of the decimal point, and rounded up. Then, check whether the valid bit is <= p + | s |.
S = 0
In this case, NUMBER indicates an integer.
Eg:
Actual Data Specified As Stored
----------------------------------------
123.89 NUMBER 123.89
123.89 NUMBER (3) 124
123.89 NUMBER (123.89)
123.89 NUMBER (6, 1) 123.9
123.89 NUMBER () exceeds precision (valid bits: 5, 5> 4)
123.89 NUMBER (6,-2) 100
. 01234 NUMBER (01234). (effective bit: 4)
. 00012 NUMBER (00012 ).
. 000127 NUMBER (00013 ).
. 0000012 NUMBER (0000012 ).
. 00000123 NUMBER (0000012 ).
1.2e-4 NUMBER (2, 5) 0.00012
1.2e-5 NUMBER (0.00001)
123.2564 NUMBER 123.2564
1234.9876 NUMBER (1234.99)
12345.12345 NUMBER () Error (valid bit: 5 + 2> 6)
1234.9876 NUMBER (6) 1235 (s does not indicate s = 0)
12345.345 NUMBER (5,-2) 12300
1234567 NUMBER (5,-2) 1234600
12345678 NUMBER (5,-2) Error (valid 8> 7)
123456789 NUMBER (5,-4) 123460000
1234567890 NUMBER (5,-4) Error (valid value: 10> 9)
12345.58 NUMBER (*, 1) 12345.6
0.1 NUMBER (0.10000) Error (, valid bit: 5> 4)
0.01234567 NUMBER (0.01235)
0.09999 NUMBER (0.09999)
This article is from "the angel who falls into the mortal world"