formatUnits
Convert blockchain value to readable units using specified decimals or unit names for clearer Ethereum network interactions.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
unit | Yes | The number of decimals or unit name (e.g., 'gwei', 18) | |
value | Yes | The value to format |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"unit": {
"description": "The number of decimals or unit name (e.g., 'gwei', 18)",
"type": [
"string",
"number"
]
},
"value": {
"description": "The value to format",
"type": "string"
}
},
"required": [
"value",
"unit"
],
"type": "object"
}