如何在Noe4j中精确到一定程度?

时间:2014-08-02 11:57:31

标签: neo4j cypher rounding

目前neo4j中的Round函数舍入到最接近的整数,但是能够执行以下操作会很棒:

round(56.1214740,3) to get 56.121
round(67.3453451,2) to get 67.35
round(3.23454325) to get 3

怎么做?

1 个答案:

答案 0 :(得分:1)

目前在neo4j中存在此限制。

我是通过以下方式完成的:

round(10.0^2 * 56.1214740)/10.0^2
round(10.0^3 * 67.3453451)/10.0^3

见:https://github.com/neo4j/neo4j/issues/1580