Below is my sample code
<dw:transform-message doc:name="Transform Message" >
<dw:set-payload><![CDATA[ %dw 1.0
%output application/json skipNullOn = "everywhere"
%function addTrailingZeros (numberWithoutTrailingZeros) (
numberWithoutTrailingZeros as :number {class: "java.lang.BigDecimal"}
)
---
"test" : addTrailingZeros(12.00)
]]></dw:set-payload>
</dw:transform-message>
Output i am getting is
{
"test": 12
}
But i want this { "test": 12.00 }
I tried with {format:"#.00"} but it's not working. If you pass 12.01 its working.
Kindly help me on this issue. Even simplest example
{"test" : 7.00 as :number {format:'#.###'}}
not working