码迷,mamicode.com
首页 > 数据库 > 详细

关于oracle中的数字类型

时间:2018-07-12 13:26:01      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:进制   precision   理解   round   from   ant   ima   ast   换算   

1.关于number类型。

以下是从其文档中摘录出的一句话:

p is the precision, or the total 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.

其中20 base-100 digits有些难理解,查了一下发现是百进制的20个数字,换算成10进制也就是10进制的40个数字。

 

关于oracle中的数字类型

标签:进制   precision   理解   round   from   ant   ima   ast   换算   

原文地址:https://www.cnblogs.com/vanwoos/p/9298323.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!