lbry-desktop/ui/util/number.js

6 lines
137 B
JavaScript
Raw Normal View History

// @flow
export function formatNumberWithCommas(num: number): string {
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
}