%dw 2.0
import fromHex from dw::core::Numbers
output application/json
---
{
a: fromHex("-1"),
b: fromHex("3e3aeb4ae1383562f4b82261d969f7ac94ca4000000000000000"),
c: fromHex(0),
d: fromHex(null),
e: fromHex("f"),
}
DataWeave
fromHex
fromHex(String): Number
Transforms a hexadecimal number into decimal number.
Introduced in DataWeave 2.2.0. Supported by Mule 4.2 and later.
Parameters
Name | Description |
---|---|
|
The hexadecimal number represented in a |
Example
This example shows how the toBinary
behaves with different inputs.
Source
Output
{
"a": -1,
"b": 100000000000000000000000000000000000000000000000000000000000000,
"c": 0,
"d": null,
"e": 15
}
JSON
fromHex(Null): Null
Helper function that enables fromHex
to work with null value.