2020-10-08 18:34:48 +02:00
|
|
|
// @flow
|
|
|
|
|
2021-01-12 16:25:51 +01:00
|
|
|
export function formatNumberWithCommas(num: number, numberOfDigits?: number): string {
|
|
|
|
return num.toLocaleString('en', { minimumFractionDigits: numberOfDigits !== undefined ? numberOfDigits : 8 });
|
2020-10-08 18:34:48 +02:00
|
|
|
}
|
2022-02-25 21:01:14 +01:00
|
|
|
|
|
|
|
export function isTrulyANumber(num: number) {
|
|
|
|
// typeof NaN = 'number' but NaN !== NaN
|
|
|
|
return typeof num === 'number' && num === num; // eslint-disable-line
|
|
|
|
}
|