NUMBER Data Type

Specify a fixed-point number using the following form:

NUMBER(p,s)

where:

  • p is the precision, or the maximum number of significant decimal digits, where the most significant digit is the left-most nonzero digit, and the least significant digit is the right-most known digit. Oracle guarantees the portability of numbers with precision of up to 20 base-100 digits, which is equivalent to 39 or 40 decimal digits depending on the position of the decimal point.

    p相当于有效数字,最左边非零到最右边数字。

  • s is the scale, or the number of digits from the decimal point to the least significant digit. The scale can range from -84 to 127.

    • Positive scale is the number of significant digits to the right of the decimal point to and including the least significant digit.

    • Negative scale is the number of significant digits to the left of the decimal point, to but not including the least significant digit. For negative scale the least significant digit is on the left side of the decimal point, because the actual data is rounded to the specified number of places to the left of the decimal point. For example, a specification of (10,-2) means to round to hundreds.

      s

      正数包括最小有意义数,比如

      .000127

      NUMBER(4,5)

      .00013

      s是5,小数点右边第五位是最小有意义的数,也就是从第五位四舍五入( including the least significant digit

      如果是负数,不包括最小有意义数,比如:

      123.89

      NUMBER(6,-2)

      100

      最小有意义数是百位(从百位四舍五入的),而-2是个位,( not including the least significant digit

      参考:http://docs.oracle.com/cd/E11882_01/server.112/e26088/sql_elements001.htm#SQLRF00222

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值