@neutrium/formatter - v1.0.1
    Preparing search index...

    Interface NumericValueObject

    Structurally compatible exact numeric object, such as @neutrium/decimal. The returned string uses numeric syntax accepted by Decimal, including radix prefixes and digit separators, rather than localized presentation syntax.

    import { formatter, type NumericValueObject } from "@neutrium/formatter";

    const amount = { toValue: () => "9007199254740993.25" } satisfies NumericValueObject;
    formatter.format(amount, { kind: "number", maximumFractionDigits: 2 });
    // "9,007,199,254,740,993.25"
    interface NumericValueObject {
        toValue(): string;
    }
    Index
    • Returns an exact numeric string in a syntax accepted by Decimal.

      Returns string