Oracle圆形负数decimal_places?

时间:2017-01-05 10:28:57

标签: oracle oracle11g oracle11gr2

我们知道并且explained here oracle data.id函数将对数字进行舍入 向上或向下,我可以选择我想要使用的数字,但是 我看到了一个ROUND如下的函数

示例:

ROUND

减号意味着什么?这是什么剂量????

1 个答案:

答案 0 :(得分:1)

根据the documentation

  

ROUND将n舍入返回到小数点右侧的整数位置。如果省略整数,则n舍入为零。 如果整数为负数,则n在小数点左侧四舍五入。

所以:

  • round(n, 0)n舍入到最近的单位
  • round(n, 1)轮次n到最近的第十个
  • round(n, -1)n舍入到最近的十个
  • round(n, 2)轮次n到最近的百分之一
  • round(n, -2)n舍入到最近的数百