Use historic BTC rate for expense items; allow BTC as currency
This commit is contained in:
@@ -2,10 +2,14 @@ import { helper } from '@ember/component/helper';
|
||||
|
||||
export default helper(function fmtFiatCurrency(params) {
|
||||
const lang = navigator.language || navigator.userLanguage;
|
||||
const value = params[0];
|
||||
const currency = params[1] || 'EUR';
|
||||
|
||||
if (currency === 'BTC') return `BTC ${value}`;
|
||||
|
||||
const formatter = new Intl.NumberFormat(lang, {
|
||||
style: 'currency',
|
||||
currency: params[1] || 'EUR',
|
||||
currencyDisplay: 'code'
|
||||
style: 'currency', currency, currencyDisplay: 'code'
|
||||
})
|
||||
|
||||
return formatter.format(params[0]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user