diff options
Diffstat (limited to 'extension/lib/commonHelpers.js')
-rw-r--r-- | extension/lib/commonHelpers.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/extension/lib/commonHelpers.js b/extension/lib/commonHelpers.js new file mode 100644 index 000000000..95faf1112 --- /dev/null +++ b/extension/lib/commonHelpers.js @@ -0,0 +1,15 @@ +"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); +}); |