# Value.fromGwei

Parses a string representation of Gwei to a `bigint` Value (default: wei).

## Imports

:::code-group
```ts [Named]
import { Value } from 'ox'
```

```ts [Entrypoint]
import * as Value from 'ox/Value'
```
:::

## Examples

```ts twoslash
import { Value } from 'ox'

Value.fromGwei('420')
// @log: 420000000000n
```

## Definition

```ts
function fromGwei(
  gwei: string,
  unit?: 'wei',
): bigint
```

**Source:** [src/core/Value.ts](https://github.com/wevm/ox/blob/main/src/core/Value.ts#L279)

## Parameters

### gwei

* **Type:** `string`

String representation of Gwei.

### unit

* **Type:** `'wei'`
* **Optional**

The unit to parse to.

## Return Type

A `bigint` Value.

`bigint`
