7 lines
116 B
JavaScript
7 lines
116 B
JavaScript
class NumberUtil {
|
|
|
|
static numberWithCommas(x) {
|
|
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
}
|
|
|
|
} |