wallet-core/extension/lib/commonHelpers.js
2015-12-20 21:38:41 +01:00

16 lines
427 B
JavaScript

"use strict";
Handlebars.registerHelper('prettyAmount', function (amount) {
let v = amount.value + amount.fraction / 1e6;
return v.toFixed(2) + " " + amount.currency;
});
Handlebars.registerHelper('prettyAmountNoCurrency', function (amount) {
let v = amount.value + amount.fraction / 1e6;
return v.toFixed(2);
});
Handlebars.registerHelper('objectStringifier', function (o) {
return JSON.stringify(o);
});