UI: money format browser compatibility (#18459)
This commit is contained in:
parent
e59aead868
commit
c426fe006e
1 changed files with 3 additions and 1 deletions
|
|
@ -264,11 +264,13 @@ export default {
|
|||
},
|
||||
fmtMoney: function (amout = 0, currency = "EUR", decimals = true, withSymbol = false) {
|
||||
const currencyDisplay = withSymbol ? "narrowSymbol" : "code";
|
||||
const digits = decimals ? undefined : 0;
|
||||
const result = new Intl.NumberFormat(this.$i18n?.locale, {
|
||||
style: "currency",
|
||||
currency,
|
||||
currencyDisplay,
|
||||
maximumFractionDigits: decimals ? undefined : 0,
|
||||
minimumFractionDigits: digits,
|
||||
maximumFractionDigits: digits,
|
||||
}).format(amout);
|
||||
|
||||
return withSymbol ? result : result.replace(currency, "").trim();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue