Skip to content

Value.from

Parses a string representation of a Value to bigint (multiplied by the given exponent).

Imports

Named
import { Value } from 'ox'

Examples

import { Value } from 'ox'
 
Value.from('420', 9)
420000000000n

Definition

function from(
  value: string,
  decimals?: number,
): bigint

Source: src/core/Value.ts

Parameters

value

  • Type: string

The string representation of the Value.

decimals

  • Type: number
  • Optional

The exponent to multiply the Value by.

Return Type

The bigint representation of the Value.

bigint