This commit is contained in:
2019-04-19 13:34:39 +02:00
parent 3cb94fb660
commit 375d8f3275
3 changed files with 6 additions and 7 deletions

View File

@@ -0,0 +1,10 @@
const ethersUtils = require('ethers').utils;
module.exports = function (value, options = {}) {
let etherValue = ethersUtils.formatEther(value);
if (options.asFloat) {
return parseFloat(etherValue);
} else {
return parseInt(etherValue);
}
}