---
url: 'https://adk.nht.io/api/@nhtio/adk/lib/helpers/bignum/functions/formatBig.md'
---

# Function: formatBig()

```ts
function formatBig(value: number | BigNumber, precision?: number): string;
```

Defined in: [lib/helpers/bignum.ts:72](https://github.com/NHTIO/ADK/blob/v1.20260609.0/src/lib/helpers/bignum.ts#L72)

Render a [BigNumber](https://mathjs.org/docs/datatypes/bignumbers.html) (or JS number) to a string at `precision` significant digits.

## Parameters

| Parameter   | Type                                                                            | Default value       |
| ----------- | ------------------------------------------------------------------------------- | ------------------- |
| `value`     | | `number` | [`BigNumber`](https://mathjs.org/docs/datatypes/bignumbers.html) | `undefined`         |
| `precision` | `number`                                                                        | `DEFAULT_PRECISION` |

## Returns

`string`

## Remarks

* An EXACT INTEGER is rendered in full fixed notation regardless of `precision`: an integer
  carries no fractional precision to lose, so `8000000000000` stays `8000000000000` rather than
  being truncated to `8e+12`. (Bounded at 30 digits to avoid pathological astronomically-large
  integers printing thousands of characters; beyond that, sig-fig exponential is used.)
* Non-integers are rendered at `precision` significant digits (default 8), stripping trailing
  zeros — avoiding the `toPrecision` artifact that mangled safe values, while still giving the
  caller control over how many digits they want (raise `precision` for more).
* Exact zero renders as `'0'`. (Genuinely tiny values like `2.54e-5` are preserved, NOT snapped.)
