Home > Database > Mysql Tutorial > mysql TRUNCATE()函数使用实例

mysql TRUNCATE()函数使用实例

WBOY
Release: 2016-06-01 09:56:47
Original
1804 people have browsed it

TRUNCATE(X,Y)

TRUNCATE(x,y)返回数值x保留到小数点后y位的值(与ROUND最大的区别是不会进行四舍五入),请看下面实例:

<code class="language-sql">mysql>SELECT TRUNCATE(7.536432,2);
+---------------------------------------------------------+
| TRUNCATE(7.536432,2)                                    |
+---------------------------------------------------------+
| 7.53                                                    |
+---------------------------------------------------------+
1 row in set (0.00 sec)</code>
Copy after login

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