Turn from: http://blog.itpub.net/post/26/3796
Number (P,s)
p:1~38
s:-84~127
P>0, the analysis of S is divided into 2 types:
1. s>0
Accurate to the right of the decimal point s bit, and rounded. Then verify that the effective digits <=p; if s>p, there are at least s-p 0 padding to the right of the decimal point.
2. s<0
Accurate to the left of the decimal point, and rounded. Then verify that the effective digit is <=p+|s|
(Effective digits: From the first number on the left that is not 0)
The default precision in the Ps:sql service is (18,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 |