极客小将

您现在的位置是:首页 » python编程资讯

资讯内容

PostgreSQL如何四舍五入

极客小将2020-12-17-
简介PostgreSQL如何四舍五入PostgreSQL四舍五入函数如下:1、round(dpornumeric),将四舍五入到最接近的整数;2、round(vnumeric,sint)四舍五入到s位小数位。使用示例:francs=>  select round(10

sxc少儿编程网-Scratch_Python_教程_免费儿童编程学习平台

PostgreSQL如何四舍五入sxc少儿编程网-Scratch_Python_教程_免费儿童编程学习平台

PostgreSQL四舍五入函数如下:sxc少儿编程网-Scratch_Python_教程_免费儿童编程学习平台

1、round(dp or numeric),将四舍五入到**接近的整数;sxc少儿编程网-Scratch_Python_教程_免费儿童编程学习平台

2、round(v numeric, s int) 四舍五入到s位小数位。sxc少儿编程网-Scratch_Python_教程_免费儿童编程学习平台

sxc少儿编程网-Scratch_Python_教程_免费儿童编程学习平台

使用示例:sxc少儿编程网-Scratch_Python_教程_免费儿童编程学习平台

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教程sxc少儿编程网-Scratch_Python_教程_免费儿童编程学习平台

预约试听课

已有385人预约都是免费的,你也试试吧...