1 | import { bnToBn } from '../bn/toBn.js';
|
2 | import { formatDecimal } from './formatDecimal.js';
|
3 | import { getSeparator } from './getSeparator.js';
|
4 | /**
|
5 | * @name formatNumber
|
6 | * @description Formats a number into string format with thousand separators
|
7 | */
|
8 | export function formatNumber(value, { locale = 'en' } = {}) {
|
9 | const { thousand } = getSeparator(locale);
|
10 | return formatDecimal(bnToBn(value).toString(), thousand);
|
11 | }
|