我正在研究oracle数据库,我需要找到一个格式编号(P,S)的范围(最小,最大)。我知道这是正数,但不是负数。
例如正标度-
NUMBER(6,2) : {maximum:9999.99,minimum:-9999.99}
我不确定,但我认为负值应该是这样的-
NUMBER(7,-2) : {maximum:999999900,minimum:-999999900} // not sure
这是正确的吗?我找不到任何关于负尺度的解释,这里和那里只有几行。有人能帮忙吗?
发布于 2022-06-08 07:29:43
在NUMBER(6, -2)中,精度为6位,小数位数为-2表示小数点右侧有-2位数字(或相当于小数点左侧的2位零位),因此最大数为99999900,最小数为-99999900 (数字被舍入到最近的100位)。
文献资料声明:
使用以下形式指定定点数字: 编号(p,s) 其中:
p是重要十进制数字的精度或最大数目,其中最重要的数字是最左边的非零数字,而最不重要的数字是最右的最已知的数字。Oracle保证数字的可移植性,其精度可达20位-100位,根据小数点的位置,这相当于39位或40位小数。s是小数点到最小有效位的小数位数。标度范围从-84到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.https://stackoverflow.com/questions/72541542
复制相似问题