mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-16 21:33:51 +02:00
feat: add jest testing for utility functions
This commit is contained in:
@@ -47,7 +47,11 @@ function commaNumber(num) {
|
||||
if (!num) {
|
||||
return '0';
|
||||
}
|
||||
const s = String(Number(num));
|
||||
const numValue = Number(num);
|
||||
if (isNaN(numValue)) {
|
||||
return '0';
|
||||
}
|
||||
const s = String(numValue);
|
||||
return s.replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user