Render currencies etc.
This commit is contained in:
@@ -2,12 +2,12 @@
|
||||
{{#each this.itemsSorted as |reimbursement|}}
|
||||
<li>
|
||||
{{reimbursement.id}}<br>
|
||||
{{reimbursement.amount}} WBTC<br>
|
||||
{{sats-to-btc reimbursement.amount}} WBTC<br>
|
||||
vetoed: {{reimbursement.vetoed}}<br>
|
||||
pay out to: {{reimbursement.contributor.name}}<br>
|
||||
|
||||
{{#each reimbursement.expenses as |expense|}}
|
||||
{{expense.date}}: {{expense.title}}
|
||||
{{expense.date}}: {{expense.title}} - {{fmt-fiat-currency expense.amount expense.currency}}<br>
|
||||
{{/each}}
|
||||
</li>
|
||||
{{/each}}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import { helper } from '@ember/component/helper';
|
||||
|
||||
export default helper(function fmtFiatCurrency(params) {
|
||||
const formatter = new Intl.NumberFormat('en-US', {
|
||||
style: 'currency',
|
||||
currency: params[1] || 'EUR',
|
||||
minimumFractionDigits: 2
|
||||
})
|
||||
return formatter.format(params[0]);
|
||||
});
|
||||
@@ -0,0 +1,5 @@
|
||||
import { helper } from '@ember/component/helper';
|
||||
|
||||
export default helper(function satsToBtc(amount/*, hash*/) {
|
||||
return amount / 100000000;
|
||||
});
|
||||
Reference in New Issue
Block a user