Files
core/hwe/ts/util/numberWithCommas.ts
2021-09-07 00:16:28 +09:00

6 lines
121 B
TypeScript

export function numberWithCommas(x: number): string {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}