下面是一段关于CEIL 和 FLOOR 的代码 DATA:a TYPE mseg-menge, b TYPE mseg-menge, c TYPE mseg-menge. a = '1.36'. b = '1.34'. c = a / b. c = CEIL( a / b ). WRITE:/,c. "输出 2.000 c = FLOOR( a / b ). WRITE:/,c. "输出 1.000
SELECT round(52.45, 0) AS round4, round(52.54, 0) AS round5, round(52.45, 1) AS round41, round(52.54, 1) AS round51, floor(52.4) AS floor4, floor(52.5) AS floor5, ceiling(52.4) AS ceiling4, ceiling(52.5) AS ceiling5 round是四舍五入 floor是向下取整 ceiling 是向上取
用oracle sql对数字进行操作: 取上取整.向下取整.保留N位小数.四舍五入.数字格式化 取整(向下取整): select floor(5.534) from dual; select trunc(5.534) from dual; 上面两种用法都可以对数字5.534向下取整,结果为5. 如果要向上取整 ,得到结果为6,则应该用ceil select ceil(5.534) from dual; 四舍五入: SELECT round(5.534) FROM dual; ) FROM dua