Use browser's locale for currency format
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { helper } from '@ember/component/helper';
|
||||
|
||||
export default helper(function fmtFiatCurrency(params) {
|
||||
const formatter = new Intl.NumberFormat('en-US', {
|
||||
const lang = navigator.language || navigator.userLanguage;
|
||||
const formatter = new Intl.NumberFormat(lang, {
|
||||
style: 'currency',
|
||||
currency: params[1] || 'EUR',
|
||||
minimumFractionDigits: 2
|
||||
currencyDisplay: 'code'
|
||||
})
|
||||
return formatter.format(params[0]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user