目录
- int()
- [round(double a)](#round(double a))
- [round(double a,int d)](#round(double a,int d))
- floor()
- ceil()
int()
向零取整,即向接近零的方向取整。
sql
int(5.6)
输出:5
sql
int(-5.6)
输出:-5
round(double a)
四舍五入取整
sql
select round(5.6)
输出:6
sql
select round(-5.6)
输出:-6
round(double a,int d)
指定精度四舍五入取整
sql
select round(5.6667,2)
输出:5.67
sql
select round(-5.6667,2)
输出:-5.67
floor()
sql
向下取整
sql
select floor(5.6)
输出:5
sql
select floor(-5.6)
输出:-6
ceil()
sql
向上取整
sql
select ceil(5.6)
输出:6
sql
select ceil(-5.6)
输出:-5