ROUND(x,y)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ROUND(x,y)相关的知识,希望对你有一定的参考价值。

ROUND(x,y) 用于对 x 进行四舍五入,并保留小数点后 y 位

mysql> SELECT ROUND(1.38,1), ROUND(1.38,0), ROUND(232.38,-1), ROUND(232.38,-2);
+---------------+---------------+------------------+------------------+
| ROUND(1.38,1) | ROUND(1.38,0) | ROUND(232.38,-1) | ROUND(232.38,-2) |
+---------------+---------------+------------------+------------------+
|           1.4 |             1 |              230 |              200 |
+---------------+---------------+------------------+------------------+

 

 

 

 

    

以上是关于ROUND(x,y)的主要内容,如果未能解决你的问题,请参考以下文章

ROUND(x,y)

Codeforces Round #635 (Div. 2) AIchihime and Triangle

round(x,y)和format(x,y)

Codeforces Round #594 (Div. 2)

DIV_ROUND_UP(x,y)实现x/y向上取整

Codeforces Round #561 (Div. 2)