aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/token-util.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/token-util.js')
-rw-r--r--ui/app/token-util.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/ui/app/token-util.js b/ui/app/token-util.js
index eec518556..f84051ef5 100644
--- a/ui/app/token-util.js
+++ b/ui/app/token-util.js
@@ -31,6 +31,15 @@ const tokenInfoGetter = function () {
}
}
+function calcTokenAmount (value, decimals) {
+ const multiplier = Math.pow(10, Number(decimals || 0))
+ const amount = Number(value / multiplier)
+
+ return amount
+}
+
+
module.exports = {
tokenInfoGetter,
+ calcTokenAmount,
}