mirror of
https://github.com/kirameki-cafe/Yumi.git
synced 2026-09-13 10:49:20 +00:00
10 lines
232 B
TypeScript
10 lines
232 B
TypeScript
export default class StringUtils {
|
|
public static numberWithCommas(x: Number) {
|
|
try {
|
|
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
} catch (err) {
|
|
return x;
|
|
}
|
|
}
|
|
}
|