Home > Database > Mysql Tutorial > body text

关于数据库中保留小数位的问题_MySQL

WBOY
Release: 2016-06-01 13:25:16
Original
1068 people have browsed it

bitsCN.com

在数据库中有时我们可能需要对一些数据进行处理,例如四舍五入、直接舍去后面的几位等,其实很简单,都是有现成的函数,我们只需要套用就行了:
select round(10.98*10)/10 from dual;--四舍五入
select ceil(10.63*10)/10 from dual;--取上限值
select floor(10.68*10)/10 from dual;--取下限值

bitsCN.com
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template