Built-in action Built In

Convert a human-readable decimal amount (e.g. '3.75') to its smallest-unit integer representation (e.g. '3750000' for USDC with 6 decimals). Uses string math — no floating-point errors. Works for any ERC-20 token.

At a Glance

FieldValue
Action IDconvert-to-wei
CategoryBuilt In
ConnectorNot required
Requires gasNo
Funds movementNone declared
Tagsutility, transformer, wei, token, conversion, onchain

Payload Schema

FieldTypeRequiredDescription
valuestringYesHuman-readable decimal amount to convert. Supports workflow variables like {{node.result.amount}}.
decimalsnumberYesNumber of decimals for the token. Common values: 6 (USDC, USDT), 8 (WBTC), 18 (ETH, most ERC-20).

Result Schema

FieldTypeRequiredDescription
weistringYesInteger string in smallest units (wei). No decimal point. Use this value for on-chain transactions.

Examples

json
{ "type": "convert-to-wei", "payload": { "value": "3.75", "decimals": 6 }, "children": []}

Payload fields can use workflow expressions such as {{$trigger.body.amount}}, {{$nodes.fetch.result.price}}, and {{$props.asset}} when the value should come from a trigger, prior node, or reusable workflow prop.

Ask a question... ⌘I