[html-chart] add percent formatter for numbers for older javascript

addendum to f99168064 for win32 builds
This commit is contained in:
Christopher Lam 2022-08-21 16:48:59 +08:00
parent 1b384df622
commit 9642025745

View File

@ -351,8 +351,12 @@ var toLocaleStringSupportsOptions = (typeof Intl == 'object' && Intl && typeof I
function numformat(amount) {
if (toLocaleStringSupportsOptions) {
return amount.toLocaleString(undefined, {style:formsty, currency:curriso});
} else {
} else if (formsty == 'percent') {
return (100 * amount).toLocaleString() + '%';
} else if (formsty == 'currency') {
return currsym + amount.toLocaleString();
} else {
return amount.toLocaleString();
}
}
")