mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[html-chart] add percent formatter for numbers for older javascript
addendum to f99168064
for win32 builds
This commit is contained in:
parent
1b384df622
commit
9642025745
@ -351,8 +351,12 @@ var toLocaleStringSupportsOptions = (typeof Intl == 'object' && Intl && typeof I
|
|||||||
function numformat(amount) {
|
function numformat(amount) {
|
||||||
if (toLocaleStringSupportsOptions) {
|
if (toLocaleStringSupportsOptions) {
|
||||||
return amount.toLocaleString(undefined, {style:formsty, currency:curriso});
|
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();
|
return currsym + amount.toLocaleString();
|
||||||
|
} else {
|
||||||
|
return amount.toLocaleString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
")
|
")
|
||||||
|
Loading…
Reference in New Issue
Block a user