如何以货币格式(带有 $ 符号)获取 neo4j 查询的输出?
How to get the output of the neo4j query in currency format (With $ symbol)?
对于以下查询(伪查询)
MATCH (data:DATA { id: 123 })
WITH data
RETURN
apoc.temporal.format(data.last_seen, "MM/dd/YYYY HH:mm:ss") AS last_seen,
data.amount As amount
ORDER BY last_seen DESC;
我想要这样的输出:
last_seen: '08/31/2021 12:03:26'
amount: .00
last_seen
没问题。但是我没有找到格式化 amount
列的方法。
经历了https://neo4j.com/labs/apoc/4.1/mathematical/number-conversions/
但是我没有找到在开头添加$
符号的方法。
因为您已经找到 apoc:
COALESCE ( '$'+ apoc.number.format(data.amount, '#,##0.00;(#,##0.00)', 'it'), '无金额' )
对于以下查询(伪查询)
MATCH (data:DATA { id: 123 })
WITH data
RETURN
apoc.temporal.format(data.last_seen, "MM/dd/YYYY HH:mm:ss") AS last_seen,
data.amount As amount
ORDER BY last_seen DESC;
我想要这样的输出:
last_seen: '08/31/2021 12:03:26'
amount: .00
last_seen
没问题。但是我没有找到格式化 amount
列的方法。
经历了https://neo4j.com/labs/apoc/4.1/mathematical/number-conversions/
但是我没有找到在开头添加$
符号的方法。
因为您已经找到 apoc:
COALESCE ( '$'+ apoc.number.format(data.amount, '#,##0.00;(#,##0.00)', 'it'), '无金额' )