https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat
// options: interface NumberFormatOptions { localeMatcher?: string; style?: string; currency?: string; currencyDisplay?: string; currencySign?: string; useGrouping?: boolean; minimumIntegerDigits?: number; minimumFractionDigits?: number; maximumFractionDigits?: number; minimumSignificantDigits?: number; maximumSignificantDigits?: number; } const numberFormatter = new Intl.NumberFormat("nl-NL", { maximumFractionDigits: 2 }); export function formatNumber(x: number): string { return numberFormatter.format(x); }
574500cookie-checkTypescript / javascript number format