anypoint studio - Mule Dataweave format :number -
i'm having issue trying parse string double sample code, it's returning integer instead of type :double ideas?
{ "data": "22" :number { format: "##.##" } }
this, , this, works me;
%dw 1.0 %output application/json --- { data: "22" :number :string {format: ".00"} :number }
format seems add zeros when converting number string. if "22" have been number wouldn't need first :number conversion;
data: 22 :string {format: ".00"} :number
the latter number conversion makes output float. otherwise string, formatted according hosts locale.
and beware. when using%output text/json
instead, above code in cases produces 22.0 instead of 22.00.
Comments
Post a Comment