修复逗号后的位数

时间:2015-11-08 21:34:48

标签: neo4j cypher

我想修改Cypher查询的十进制结果的逗号(或小数点)后面的位数:

        textView.setText((Html.fromHtml(text)).toString().replaceAll("\\</br.*?>","\\\n"));

我该怎么办?

1 个答案:

答案 0 :(得分:1)

据我所知,没有办法舍入到特定的小数精度,所以你必须乘以总计,将它四舍五入除以你再次乘以的相同数字,以回到你想要的精度。

考虑以下示例来舍入到最接近的千分之一。

with 1.23456789 as dec_raw
return round(dec_num * 1000) / 1000 as dec_precision
相关问题