> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# Value

:::info
`Value` is a re-export of ox's [`Value`](https://oxlib.sh/api/Value). Refer to the ox documentation for the full reference.
:::

Utility functions for displaying and parsing Ethereum Values as defined under **2.1. Value** in the [Ethereum Yellow Paper](https://ethereum.github.io/yellowpaper/paper.pdf)

## Examples

```ts twoslash
// @noErrors
import { Value } from 'viem/utils'

const value = Value.fromEther('1')
// @log: 1_000_000_000_000_000_000n

const formattedValue = Value.formatEther(value)
// @log: '1'

const value = Value.fromEther('1', 'szabo')
// @log: 1_000_000n
```

## Functions

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`Value.format`](/docs/utilities/value/format) | Formats a `bigint` Value to its string representation (divided by the given exponent). |
| [`Value.formatEther`](/docs/utilities/value/formatEther) | Formats a `bigint` Value (default: wei) to a string representation of Ether. |
| [`Value.formatGwei`](/docs/utilities/value/formatGwei) | Formats a `bigint` Value (default: wei) to a string representation of Gwei. |
| [`Value.from`](/docs/utilities/value/from) | Parses a `string` representation of a Value to `bigint` (multiplied by the given exponent). |
| [`Value.fromEther`](/docs/utilities/value/fromEther) | Parses a string representation of Ether to a `bigint` Value (default: wei). |
| [`Value.fromGwei`](/docs/utilities/value/fromGwei) | Parses a string representation of Gwei to a `bigint` Value (default: wei). |

## Errors

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`Value.InvalidDecimalNumberError`](/docs/utilities/value/errors#valueinvaliddecimalnumbererror) | Thrown when a value is not a valid decimal number. |
| [`Value.InvalidDecimalsError`](/docs/utilities/value/errors#valueinvaliddecimalserror) | Thrown when the `decimals` argument is not a non-negative integer. |
