Actions53
- Account Actions
- Block Actions
- Transaction Actions
- Contract Actions
- ERC20 Actions
- ERC721 Actions
- ERC1155 Actions
- Gas Actions
- Signature Actions
- Utils Actions
- Custom RPC Actions
Utils → Parse Units
AI-generatedSummary
Parse a decimal value using a specified number of units.
Inputs
- decimals — Number of decimals (18 for ETH)
- value (required) — Decimal value (e.g., "1.5")
Output shape
a string
Returns the parsed numeric representation of the input value as a string; errors are propagated as failures.
Examples
Example 1: Convert 1.5 ETH to its raw unit representation
value=1.5, decimals=18
Example 2: Parse a token amount with 6 decimal places
value=1234.56, decimals=6
Example 3: Parse a whole number with no decimal places
value=42, decimals=0