Use historic BTC rate for expense items; allow BTC as currency

This commit is contained in:
2024-12-18 12:34:31 +04:00
parent 89ddde28b8
commit 697ace35b5
8 changed files with 73 additions and 43 deletions
+7 -3
View File
@@ -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]);
});