...I'm using Anypoint Studio 7.6 and writing in DataWeave 2.0
I cannot find the definitive way to include the $ (dollar sign) character in a quoted string.
Here's what I tried:
%dw 2.0
output application/dw
var sign = "\u0024" // unicode dollar sign
type currency = String {format: "$sign ###.00"} // interpolation from previous var
var cost = 100 as currency
---
{
directly: "a dollar sign like this: \$",
asdefined: sign,
indirectly: "This flight, costs $(cost), and is operated by "
++ payload.airline
}
Here's what I got for my trouble:
{
directly: "a dollar sign like this: \$",
asdefined: "\$",
indirectly: "This flight, costs \$ 100.00, and is operated by United"
}
I feel like I'm missing something simple.