effect-io-ai

Package: effect
Module: BigDecimal

BigDecimal.toExponential

Formats a given BigDecimal as a string in scientific notation.

When to use

Use to render a BigDecimal in scientific notation.

Example (Formatting decimals exponentially)

import { BigDecimal } from "effect"
import * as assert from "node:assert"

assert.deepStrictEqual(BigDecimal.toExponential(BigDecimal.make(123456n, -5)), "1.23456e+10")

See

Signature

declare const toExponential: (n: BigDecimal) => string

Source

Since v3.11.0