Skip to content

Commit

Permalink
Fix bin
Browse files Browse the repository at this point in the history
  • Loading branch information
rastislavcore committed Oct 24, 2022
1 parent 61da5ed commit 7f7559e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/core-unit-converter
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/env node

const { BigNumber } = require('ethers')
const { BigNumber } = require('bignumber.js')
const convert = require('../')

if (process.stdin) {
process.stdin.setEncoding('utf8')
process.stdin.resume()
let content = ''
process.stdin.on('data', (buf) => {
content += buf.toString()
content += buf.toFixed()
})
setTimeout(() => {
content = content.trim()
Expand Down Expand Up @@ -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]) {
Expand Down

0 comments on commit 7f7559e

Please sign in to comment.