Files
Yumi/src/utils/StringUtils.ts
T

10 lines
232 B
TypeScript
Raw Normal View History

2023-04-23 13:35:13 +07:00
export default class StringUtils {
public static numberWithCommas(x: Number) {
try {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
} catch (err) {
return x;
}
}
}