This commit is contained in:
2020-02-07 00:51:36 +00:00
parent 99d37a2d5b
commit ff35bda367
4 changed files with 46 additions and 23 deletions

View File

@@ -376,6 +376,24 @@ export default {
});
}
},
///////////////////////////////////////////
// Turn a decimal number into a local
// currency display
//
currencyLocalized(value, languageName, currencyName) {
if (!value) return "";
if (!languageName) {
languageName = this.getBrowserLanguages();
}
if (!currencyName) {
currencyName = window.$gz.store.state.locale.currencyName;
}
return new Intl.NumberFormat(languageName, {
style: "currency",
currency: currencyName
}).format(value);
},
////////////////////////////////////////////////////////
// dynamically set the vuetify language elements from
// users localized text (am/pm etc)