diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2015-12-16 17:52:25 +0100 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2015-12-16 17:52:25 +0100 |
commit | a16589a5d93fe0767973a8e12e9bdd7e6d8ad55e (patch) | |
tree | 39629a78240ba17c31e495c520dc05b763521083 /extension/lib/commonHelpers.js | |
parent | 1c5cb3819718a15523b39f532ff70994eded051f (diff) |
Making the balance appear
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); +}); |