effect-io-ai

Package: effect
Module: BigDecimal

BigDecimal.fromBigInt

Creates a BigDecimal from a bigint value.

When to use

Use to construct an integer BigDecimal from a bigint.

Example (Creating decimals from bigint)

import { BigDecimal } from "effect"

const decimal = BigDecimal.fromBigInt(123n)
console.log(BigDecimal.format(decimal)) // "123"

const largeBigInt = BigDecimal.fromBigInt(9007199254740991n)
console.log(BigDecimal.format(largeBigInt)) // "9007199254740991"

See

Signature

declare const fromBigInt: (n: bigint) => BigDecimal

Source

Since v2.0.0