# format_units

Scales raw EVM integer balances by 10^decimals and returns a VARCHAR string representation. No floating point conversion is introduced. The default decimal scale is 18. INT256 inputs preserve signed values, and trailing fractional zeros are trimmed from the formatted string.

Canonical HTML: <https://determica.com/docs/functions/format_units>

- Kind: scalar function
- Category: [EVM utilities](/docs/category/evm-utilities.md)
- Tags: Types, EVM

Scales raw EVM integer balances by 10^decimals and returns a VARCHAR string representation. No floating point conversion is introduced. The default decimal scale is 18. INT256 inputs preserve signed values, and trailing fractional zeros are trimmed from the formatted string.

## Overload 1: format_units(UINT256)

```sql
format_units(UINT256)
```

Formats a raw amount of type UINT256 using the default 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (UINT256; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 2: format_units(UINT256, INTEGER)

```sql
format_units(UINT256, INTEGER)
```

Formats a raw amount of type UINT256 using a decimal scale of type INTEGER.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (UINT256; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

### Examples

_Local SQL · Local_

```sql
-- Display a raw 6-decimal USDC balance
SELECT format_units(12345678::UINT256, 6) AS usdc;
-- => [{"usdc":"12.345678"}]
```

## Overload 3: format_units(UINT256, UTINYINT)

```sql
format_units(UINT256, UTINYINT)
```

Formats a raw amount of type UINT256 using a decimal scale of type UTINYINT.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (UINT256; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 4: format_units(UINT256, UINT8)

```sql
format_units(UINT256, UINT8)
```

Formats a raw amount of type UINT256 using a decimal scale of type UINT8.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (UINT256; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 5: format_units(INT256)

```sql
format_units(INT256)
```

Formats a raw amount of type INT256 using the default 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (INT256; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 6: format_units(INT256, INTEGER)

```sql
format_units(INT256, INTEGER)
```

Formats a raw amount of type INT256 using a decimal scale of type INTEGER.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (INT256; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

### Examples

_Local SQL · Local_

```sql
-- Preserve the sign of a raw 6-decimal accounting delta
SELECT format_units((-1234567)::INT256, 6) AS pnl_usdc;
-- => [{"pnl_usdc":"-1.234567"}]
```

## Overload 7: format_units(INT256, UTINYINT)

```sql
format_units(INT256, UTINYINT)
```

Formats a raw amount of type INT256 using a decimal scale of type UTINYINT.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (INT256; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 8: format_units(INT256, UINT8)

```sql
format_units(INT256, UINT8)
```

Formats a raw amount of type INT256 using a decimal scale of type UINT8.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (INT256; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 9: format_units(UTINYINT)

```sql
format_units(UTINYINT)
```

Formats a raw amount of type UTINYINT using the default 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (UTINYINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 10: format_units(UTINYINT, INTEGER)

```sql
format_units(UTINYINT, INTEGER)
```

Formats a raw amount of type UTINYINT using a decimal scale of type INTEGER.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (UTINYINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 11: format_units(UTINYINT, UTINYINT)

```sql
format_units(UTINYINT, UTINYINT)
```

Formats a raw amount of type UTINYINT using a decimal scale of type UTINYINT.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (UTINYINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 12: format_units(UTINYINT, UINT8)

```sql
format_units(UTINYINT, UINT8)
```

Formats a raw amount of type UTINYINT using a decimal scale of type UINT8.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (UTINYINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 13: format_units(USMALLINT)

```sql
format_units(USMALLINT)
```

Formats a raw amount of type USMALLINT using the default 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (USMALLINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 14: format_units(USMALLINT, INTEGER)

```sql
format_units(USMALLINT, INTEGER)
```

Formats a raw amount of type USMALLINT using a decimal scale of type INTEGER.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (USMALLINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 15: format_units(USMALLINT, UTINYINT)

```sql
format_units(USMALLINT, UTINYINT)
```

Formats a raw amount of type USMALLINT using a decimal scale of type UTINYINT.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (USMALLINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 16: format_units(USMALLINT, UINT8)

```sql
format_units(USMALLINT, UINT8)
```

Formats a raw amount of type USMALLINT using a decimal scale of type UINT8.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (USMALLINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 17: format_units(UINTEGER)

```sql
format_units(UINTEGER)
```

Formats a raw amount of type UINTEGER using the default 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (UINTEGER; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 18: format_units(UINTEGER, INTEGER)

```sql
format_units(UINTEGER, INTEGER)
```

Formats a raw amount of type UINTEGER using a decimal scale of type INTEGER.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (UINTEGER; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 19: format_units(UINTEGER, UTINYINT)

```sql
format_units(UINTEGER, UTINYINT)
```

Formats a raw amount of type UINTEGER using a decimal scale of type UTINYINT.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (UINTEGER; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 20: format_units(UINTEGER, UINT8)

```sql
format_units(UINTEGER, UINT8)
```

Formats a raw amount of type UINTEGER using a decimal scale of type UINT8.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (UINTEGER; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 21: format_units(UBIGINT)

```sql
format_units(UBIGINT)
```

Formats a raw amount of type UBIGINT using the default 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (UBIGINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 22: format_units(UBIGINT, INTEGER)

```sql
format_units(UBIGINT, INTEGER)
```

Formats a raw amount of type UBIGINT using a decimal scale of type INTEGER.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (UBIGINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 23: format_units(UBIGINT, UTINYINT)

```sql
format_units(UBIGINT, UTINYINT)
```

Formats a raw amount of type UBIGINT using a decimal scale of type UTINYINT.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (UBIGINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 24: format_units(UBIGINT, UINT8)

```sql
format_units(UBIGINT, UINT8)
```

Formats a raw amount of type UBIGINT using a decimal scale of type UINT8.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (UBIGINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 25: format_units(UHUGEINT)

```sql
format_units(UHUGEINT)
```

Formats a raw amount of type UHUGEINT using the default 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (UHUGEINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 26: format_units(UHUGEINT, INTEGER)

```sql
format_units(UHUGEINT, INTEGER)
```

Formats a raw amount of type UHUGEINT using a decimal scale of type INTEGER.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (UHUGEINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 27: format_units(UHUGEINT, UTINYINT)

```sql
format_units(UHUGEINT, UTINYINT)
```

Formats a raw amount of type UHUGEINT using a decimal scale of type UTINYINT.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (UHUGEINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 28: format_units(UHUGEINT, UINT8)

```sql
format_units(UHUGEINT, UINT8)
```

Formats a raw amount of type UHUGEINT using a decimal scale of type UINT8.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (UHUGEINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 29: format_units(TINYINT)

```sql
format_units(TINYINT)
```

Formats a raw amount of type TINYINT using the default 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (TINYINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 30: format_units(TINYINT, INTEGER)

```sql
format_units(TINYINT, INTEGER)
```

Formats a raw amount of type TINYINT using a decimal scale of type INTEGER.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (TINYINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 31: format_units(TINYINT, UTINYINT)

```sql
format_units(TINYINT, UTINYINT)
```

Formats a raw amount of type TINYINT using a decimal scale of type UTINYINT.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (TINYINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 32: format_units(TINYINT, UINT8)

```sql
format_units(TINYINT, UINT8)
```

Formats a raw amount of type TINYINT using a decimal scale of type UINT8.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (TINYINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 33: format_units(SMALLINT)

```sql
format_units(SMALLINT)
```

Formats a raw amount of type SMALLINT using the default 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (SMALLINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 34: format_units(SMALLINT, INTEGER)

```sql
format_units(SMALLINT, INTEGER)
```

Formats a raw amount of type SMALLINT using a decimal scale of type INTEGER.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (SMALLINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 35: format_units(SMALLINT, UTINYINT)

```sql
format_units(SMALLINT, UTINYINT)
```

Formats a raw amount of type SMALLINT using a decimal scale of type UTINYINT.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (SMALLINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 36: format_units(SMALLINT, UINT8)

```sql
format_units(SMALLINT, UINT8)
```

Formats a raw amount of type SMALLINT using a decimal scale of type UINT8.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (SMALLINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 37: format_units(INTEGER)

```sql
format_units(INTEGER)
```

Formats a raw amount of type INTEGER using the default 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (INTEGER; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 38: format_units(INTEGER, INTEGER)

```sql
format_units(INTEGER, INTEGER)
```

Formats a raw amount of type INTEGER using a decimal scale of type INTEGER.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (INTEGER; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 39: format_units(INTEGER, UTINYINT)

```sql
format_units(INTEGER, UTINYINT)
```

Formats a raw amount of type INTEGER using a decimal scale of type UTINYINT.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (INTEGER; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 40: format_units(INTEGER, UINT8)

```sql
format_units(INTEGER, UINT8)
```

Formats a raw amount of type INTEGER using a decimal scale of type UINT8.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (INTEGER; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 41: format_units(BIGINT)

```sql
format_units(BIGINT)
```

Formats a raw amount of type BIGINT using the default 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (BIGINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 42: format_units(BIGINT, INTEGER)

```sql
format_units(BIGINT, INTEGER)
```

Formats a raw amount of type BIGINT using a decimal scale of type INTEGER.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (BIGINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 43: format_units(BIGINT, UTINYINT)

```sql
format_units(BIGINT, UTINYINT)
```

Formats a raw amount of type BIGINT using a decimal scale of type UTINYINT.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (BIGINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 44: format_units(BIGINT, UINT8)

```sql
format_units(BIGINT, UINT8)
```

Formats a raw amount of type BIGINT using a decimal scale of type UINT8.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (BIGINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 45: format_units(HUGEINT)

```sql
format_units(HUGEINT)
```

Formats a raw amount of type HUGEINT using the default 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (HUGEINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 46: format_units(HUGEINT, INTEGER)

```sql
format_units(HUGEINT, INTEGER)
```

Formats a raw amount of type HUGEINT using a decimal scale of type INTEGER.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (HUGEINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (INTEGER; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 47: format_units(HUGEINT, UTINYINT)

```sql
format_units(HUGEINT, UTINYINT)
```

Formats a raw amount of type HUGEINT using a decimal scale of type UTINYINT.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (HUGEINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (UTINYINT; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Overload 48: format_units(HUGEINT, UINT8)

```sql
format_units(HUGEINT, UINT8)
```

Formats a raw amount of type HUGEINT using a decimal scale of type UINT8.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `raw_amount` (HUGEINT; required; positional) — Raw EVM integer units to display. Keep this as an integer type, not FLOAT or DOUBLE.
- `decimals` (UINT8; required; positional) — Decimal precision used by the token contract. Must be an integer between 0 and 77.

### Returns

Human-readable decimal string

Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

- `formatted_value` (VARCHAR)

Human-readable decimal string. Returns a VARCHAR decimal representation without converting through FLOAT or DOUBLE.

## Guidance

### Raw units vs display strings

format_units is the inverse display helper for parse_units. It turns raw token units into a decimal string without floating point conversion.

- Use format_units(raw_amount, decimals) for ERC-20 balances.
- Use format_ether for wei values with the fixed 18-decimal Ether scale.
- Use parse_units or parse_ether when converting human-entered strings into raw UINT256 values.
- Do not feed the returned VARCHAR back into calldata or math unless you explicitly parse it again.

```sql
SELECT
  format_units(parse_units('2500', 6), 6) AS usdc,
  format_ether(parse_ether('1.25')) AS eth;
```

## Related functions

- [parse_units](/docs/functions/parse_units.md) — Alternative
- [format_ether](/docs/functions/format_ether.md) — See Also
