> ## Documentation Index
> Fetch the complete documentation index at: https://docs.b3os.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Convert from Smallest Unit (Wei)

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

Built-in action Built In

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


## At a Glance

| Field | Value |
| --- | --- |
| Action ID | `convert-from-wei` |
| Category | Built In |
| Connector | Not required |
| Requires gas | No |
| Funds movement | None declared |
| Tags | `utility`, `transformer`, `wei`, `token`, `conversion`, `onchain` |

## Payload Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `wei` | `string` | Yes | Integer string in smallest units \(wei\) to convert. Supports workflow variables like &#123;&#123;node.result.amount&#125;&#125;. |
| `decimals` | `number` | Yes | Number of decimals for the token. Common values: 6 \(USDC, USDT\), 8 \(WBTC\), 18 \(ETH, most ERC-20\). |

## Result Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `value` | `string` | Yes | Human-readable decimal string. Trailing zeros are trimmed \(e.g. '3.75' not '3.750000'\). |

## Examples

**Workflow node**

```json
{
  "type": "convert-from-wei",
  "payload": {
    "wei": "3750000",
    "decimals": 6
  },
  "children": []
}
```
  **Test with API**

```bash
curl -X POST "https://api.b3os.org/v1/actions/convert-from-wei/test" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "inputs": {
    "wei": "3750000",
    "decimals": 6
  }
}'
```

**Use expressions for dynamic values**

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.