-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
Since - to my knowledge - Runtime 4.6, it seems that the output number in json systematically removes not-significant zeros.
As an example :
This input
%dw 2.0
import * from dw::util::Coercions
output application/json
---
{
"simpleNumber": 1.230,
"toNumber": toNumber("1.2300"),
"asNumber": 1.23000 as Number {format:"00.000"}
}
Outputs
{
"simpleNumber": 1.23,
"toNumber": 1.23,
"asNumber": 1.23
}
Therefore, either there is a bug in Dataweave, either the documentation is wrong here :
dw-coercions-functions-tonumber.adoc & MuleSoft Docs
It should be :
Output
{
"default": 1, // <---- here is the change
"withFormat": 0.005,
"withLocal": 1.25,
"withExtraPlaceholders": 5.55,
"keyToNumber": 123
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels