Use of number (P,s)

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.