Skip to content

Commit

Permalink
version 0.1.0 -- es5 support
Browse files Browse the repository at this point in the history
  • Loading branch information
SilentCicero committed Dec 7, 2016
1 parent 9c81eaf commit 685017f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.1.0 -- es5 support

1. es5 support

# 0.0.1 -- number-to-bn

1. Basic testing
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "number-to-bn",
"version": "1.0.0",
"version": "1.1.0",
"description": "A simple method that will convert a string integer, hex, BN or bignumber.js object into a BN.js object.",
"main": "src/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function numberToBN(arg) {
if (isHexPrefixed(arg)) {
return new BN(stripHexPrefix(arg), 16);
} else if (arg.substr(0, 3) === '-0x') {
return new BN(`-${arg.slice(3)}`, 16);
return new BN('-' + String(arg.slice(3)), 16);
} else { // eslint-disable-line
return new BN(arg, 10);
}
Expand Down

0 comments on commit 685017f

Please sign in to comment.