lbry-desktop/ui/util/number.js
2020-10-08 14:19:21 -04:00

5 lines
137 B
JavaScript

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