ROUND()
函数说明
ROUND()函数返回了某个数字在特定位数四舍五入后的数值。 该函数返回指定位数上最接近的数字。如果给定的数字与周围的数字距离相等(比如为5),那么将采用“banker’s rounding”(银行进位法)的方式进行舍入。
函数语法
1. > ROUND(number, decimals)
2. > ROUND(number)
参数释义
| 参数 | 说明 |
|---|---|
| number | 必要参数,想要进行舍入的数值,可取任意数值数据类型 |
| decimals | 可选参数,表示将要舍入的小数点后的位数。默认值为0,代表舍入到整数。 decimals>0 函数将舍入到小数点后的位数 decimals<0 函数将舍入到小数点前的位数 decimals=0 函数将舍入到整数 |
示例
1. round(1.5) ----> 2
2. round(2.5) ----> 2
3. round(3.5) ----> 4
4. round(12, -1) ----> 10
5. round(12) ----> 12
6. round(-12, -1) ----> -20
7. round(-12, 1) ----> -12
8. round(12.345) ----> 12
9. round(12.345, 1) ----> 12.3
10. round(-12.345, 1) ----> -12.3
11. round(-12.345, -1) ----> -10
12. round(-12.345) ----> -12
限制
MatrixOne目前只支持在查询表的时候使用函数,不支持单独使用函数。
