contracts/lib/utils/format-kredits.js
2019-04-24 19:31:04 +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);
}
};