wallet-core/extension/lib/commonHelpers.js
2015-12-16 17:52:25 +01:00

16 lines
429 B
JavaScript

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