The raw planck value as a bigint. Must be non-negative.
Optionaloptions: FormatBalanceOptionsFormatting options.
A display-ready string (e.g. "1,000.5 DOT").
If planck is negative or decimals is invalid (delegated to formatPlanck).
import { formatBalance } from "@polkadot-apps/utils";
formatBalance(10_000_000_000n); // "1"
formatBalance(15_000_000_000n, { symbol: "DOT" }); // "1.5 DOT"
formatBalance(10_000_000_000_000n, { symbol: "DOT" }); // "1,000 DOT"
formatBalance(12_345_678_900n, { maxDecimals: 2 }); // "1.23"
formatBalance(0n, { symbol: "DOT" }); // "0 DOT"
Format a planck value for display with locale-aware thousand separators, decimal truncation, and an optional token symbol.
Builds on formatPlanck for BigInt-safe conversion, then applies presentation formatting. Unlike formatPlanck, trailing
.0is omitted — display values show"1,000"not"1,000.0".