contracts/lib/utils/format-kredits.js
2019-04-19 13:34:39 +02:00

11 lines
257 B
JavaScript

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);
}
}