【发布时间】:2017-11-11 02:26:20
【问题描述】:
我通过 Dataweave 中的 xml 获得了以下号码。
<b:AmountValue>180.90</b:AmountValue>
使用 Dataweave,我试图输出一个对应的带有两位小数的 json 数字(代表货币)。
这是我的 Dataweave 表达式的样子...
amount: $.AmountValue as :number as :string {format: ".00"} as :number
输出 json 正在丢失尾随零。
i.e. "amount":180.9
如何将我的 Dataweave 表达式更改为始终保留两位小数?
或者是我对 json 数字类型的理解有误?
谢谢
【问题讨论】: