您现在的位置是:课程教程文章
PostgreSQL如何四舍五入
2023-12-18 19:20课程教程文章 人已围观
-
云贝教育 | 优化PostgreSQL Partial Writes(页裂
云贝教育 | 优化PostgreSQL Partial Writes(页裂... -
【云贝教育】PostgreSQL从入门到精通
【云贝教育】PostgreSQL从入门到精通... -
PostgreSQL数据库管理(三)
PostgreSQL数据库管理(三)PostgreSQL是以加州大学伯克利分校计算机系开发的POSTGRES,现在已经更名为Postgre... -
腾讯云数据库PostgreSQL功能与特性
腾讯云数据库PostgreSQL功能与特性【适用对象】 所有人,所有使用腾讯云数据库PostgreSQL的用户 【课程大纲】 一...
PostgreSQL如何四舍五入
PostgreSQL四舍五入函数如下:
1、round(dp or numeric),将四舍五入到最接近的整数;
2、round(v numeric, s int) 四舍五入到s位小数位。
使用示例:
francs=> select round(10.2); round ------- 10 (1 row) francs=> select round(10.9); round ------- 11 (1 row) francs=> select 10.1/3; ?column? -------------------- 3.3666666666666667 (1 row) francs=> select round(10.1/3); round ------- 3 (1 row) francs=> select round(10.1/3,2); round ------- 3.37 (1 row)
推荐:PostgreSQL教程
课程教程:PostgreSQL如何四舍五入下一篇:没有了