Use custom function for number formatting
This commit is contained in:
@@ -17,3 +17,13 @@ function formatDate(ts, showYear) {
|
||||
return month +' '+ day;
|
||||
}
|
||||
}
|
||||
|
||||
function formatNumber(num) {
|
||||
x = (''+ num).split('.');
|
||||
x1 = x[0];
|
||||
x2 = x.length > 1 ? '.' + x[1] : '';
|
||||
while (/(\d+)(\d{3})/.test(x1)) {
|
||||
x1 = x1.replace(/(\d+)(\d{3})/, '$1,$2');
|
||||
}
|
||||
return x1 + x2;
|
||||
}
|
||||
Reference in New Issue
Block a user