The NUMBER
NUMBER
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(小数点). -
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.
-
Scale can be(能够,可以) e
NUMBER(4,5)
It is good practice(好做法)
Specify an integer(整数) using the following form:
NUMBER(p)
This represents(代表) a fixed-point number with precision p
NUMBER(p,0)
.
Specify a floating-point number(浮点数) using the following form:
NUMBER
The absence(没有) of precision and scale designators(指定这,标志符) specifies the maximum range and precision for an Oracle number.
See Also(另见):
"Floating-Point Numbers" Table 3-2