# FormatTokenAmountOptions

Defined in: [core/src/utils/token-amount.ts:96](https://github.com/B3Pay/ic-reactor/blob/f1956947ae037304fce1675a38695964c1aa9e32/packages/core/src/utils/token-amount.ts#L96)

Options for [formatTokenAmount](https://ic-reactor.b3pay.net/v3/libs/functions/formattokenamount/).

## Properties

### maxFractionDigits?

> `optional` **maxFractionDigits?**: `number`

Defined in: [core/src/utils/token-amount.ts:102](https://github.com/B3Pay/ic-reactor/blob/f1956947ae037304fce1675a38695964c1aa9e32/packages/core/src/utils/token-amount.ts#L102)

The most fraction digits to show. Digits past it are dropped as
`roundingMode` says. Defaults to the token's `decimals`, which shows the
amount exactly, or to `minFractionDigits` when that is more.

***

### minFractionDigits?

> `optional` **minFractionDigits?**: `number`

Defined in: [core/src/utils/token-amount.ts:107](https://github.com/B3Pay/ic-reactor/blob/f1956947ae037304fce1675a38695964c1aa9e32/packages/core/src/utils/token-amount.ts#L107)

The fewest fraction digits to show, padded with zeros: `2` shows one ICP
as `"1.00"`. Defaults to `0`.

***

### trimTrailingZeros?

> `optional` **trimTrailingZeros?**: `boolean`

Defined in: [core/src/utils/token-amount.ts:113](https://github.com/B3Pay/ic-reactor/blob/f1956947ae037304fce1675a38695964c1aa9e32/packages/core/src/utils/token-amount.ts#L113)

Drop zeros at the end of the fraction, down to `minFractionDigits`.
Defaults to `true`, so one ICP shows as `"1"`. With `false` the fraction
is padded to `maxFractionDigits`: `"1.00000000"`.

***

### roundingMode?

> `optional` **roundingMode?**: `"trunc"` \| `"halfExpand"`

Defined in: [core/src/utils/token-amount.ts:120](https://github.com/B3Pay/ic-reactor/blob/f1956947ae037304fce1675a38695964c1aa9e32/packages/core/src/utils/token-amount.ts#L120)

How digits past `maxFractionDigits` are dropped. `"trunc"` (the default)
cuts them, so a balance of 0.99999999 shown to two digits is `"0.99"`,
never more than is held. `"halfExpand"` rounds half away from zero, as
`Intl.NumberFormat` does: `"1"`.

***

### locale?

> `optional` **locale?**: `string` \| readonly `string`[]

Defined in: [core/src/utils/token-amount.ts:127](https://github.com/B3Pay/ic-reactor/blob/f1956947ae037304fce1675a38695964c1aa9e32/packages/core/src/utils/token-amount.ts#L127)

A BCP 47 locale, such as `"de-DE"`, whose decimal separator, grouping and
digits to use, through `Intl.NumberFormat`. Without one the text is plain:
`-`, the digits 0-9 and `.`, the form [parseTokenAmount](https://ic-reactor.b3pay.net/v3/libs/functions/parsetokenamount/) reads back,
and the same on the server and in every browser.

***

### useGrouping?

> `optional` **useGrouping?**: `boolean`

Defined in: [core/src/utils/token-amount.ts:133](https://github.com/B3Pay/ic-reactor/blob/f1956947ae037304fce1675a38695964c1aa9e32/packages/core/src/utils/token-amount.ts#L133)

Group the whole part into thousands. Without a `locale` this writes `,`
every three digits and defaults to `false`; with one it follows the
locale, as `Intl.NumberFormat` does.