From 7f7559ec068fcdf41cca52fad0cfc28e06f0464a Mon Sep 17 00:00:00 2001 From: Rastislav Date: Mon, 24 Oct 2022 23:26:20 +0200 Subject: [PATCH] Fix bin --- bin/core-unit-converter | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/core-unit-converter b/bin/core-unit-converter index ba25779..59b1c17 100755 --- a/bin/core-unit-converter +++ b/bin/core-unit-converter @@ -1,6 +1,6 @@ #!/usr/bin/env node -const { BigNumber } = require('ethers') +const { BigNumber } = require('bignumber.js') const convert = require('../') if (process.stdin) { @@ -8,7 +8,7 @@ if (process.stdin) { process.stdin.resume() let content = '' process.stdin.on('data', (buf) => { - content += buf.toString() + content += buf.toFixed() }) setTimeout(() => { content = content.trim() @@ -64,7 +64,7 @@ function run (value, unit, toUnit) { try { if (value.startsWith('0x')) { - value = BigNumber.from(value).toString() + value = BigNumber.from(value).toFixed() } value = value.replace(/[^0-9.e+-]+/gi, '') if (powUnits[unit]) {