Skip to main content

formatNumber

Formats a number for display with the grouping, decimals and digits of locale. The locale is named explicitly so output never depends on the visitor's settings; callers pass formatLocale(catalogue).

This is a function exported by @mapcairn/core, checked against version 0.2.0.

Signature​

import { formatNumber } from "@mapcairn/core";

function formatNumber(value: number, locale: string, options?: Intl.NumberFormatOptions): string;

Parameters​

  • value (number)
  • locale (string)
  • options? (Intl.NumberFormatOptions)

Returns​

string

Source: packages/core/src/format/format.ts:150