Querydsl: Round(x) 函数

创建于 2013-07-18  ·  4评论  ·  资料来源: querydsl/querydsl

我看到有一个 round() 函数可以从数值变量中返回最接近的 int。
但是没有 round(x) 函数可以返回十进制 x 的数值。

例如:

select round(192.4525, 2) -> 192.46
select round(2.3246, 2) -> 2.32 

这里有一些文档:
http://www.postgresql.org/docs/9.1/static/functions-math.html

最有用的评论

添加到MathExpressions

所有4条评论

这在其他 SQL 方言中的支持程度如何?

添加到MathExpressions

发布于 3.2.2

此页面是否有帮助?
0 / 5 - 0 等级