关于PostgreSQL数据类型numeric的 precision和scale
参考自:
https://www.postgresql.org/docs/10/static/datatype-numeric.html#DATATYPE-NUMERIC-TABLE
scale是小数点右边小数部分 小数的位数,
参考自:
https://www.postgresql.org/docs/10/static/datatype-numeric.html#DATATYPE-NUMERIC-TABLE
We use the following terms below:
The scale of a numeric is the count of decimal digits in the fractional part, to the right of the decimal point.
The precision of a numeric is the total count of significant digits in the whole number,
that is, the number of digits to both sides of the decimal point.
scale是小数点右边小数部分 小数的位数,
precision是小数点两边所有数字中,有效数字的位数。
the number 23.5141 has a precision of 6 and a scale of 4.
Integers can be considered to have a scale of zero.
详解PostgreSQL Numeric数据类型

本文详细解释了PostgreSQL数据库中numeric数据类型的两个关键概念:precision和scale。precision定义了数值中小数点前后所有有效数字的数量,而scale则指定了小数点后的小数位数。例如,数字23.5141的precision为6,scale为4。整数被视为scale为0的numeric类型。
2507

被折叠的 条评论
为什么被折叠?



