wallet-core/extension/lib/commonHelpers.js

16 lines
427 B
JavaScript
Raw Normal View History

2015-12-16 17:52:25 +01:00
"use strict";
Handlebars.registerHelper('prettyAmount', function (amount) {
2015-12-20 21:38:41 +01:00
let v = amount.value + amount.fraction / 1e6;
2015-12-16 17:52:25 +01:00
return v.toFixed(2) + " " + amount.currency;
});
Handlebars.registerHelper('prettyAmountNoCurrency', function (amount) {
2015-12-20 21:38:41 +01:00
let v = amount.value + amount.fraction / 1e6;
2015-12-16 17:52:25 +01:00
return v.toFixed(2);
});
Handlebars.registerHelper('objectStringifier', function (o) {
return JSON.stringify(o);
});