From 24737ded3466da61fd96015beb6931e59d8232a7 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 17 May 2017 14:13:05 -0700 Subject: Fix bug where decimals in gas inputs gave strange results --- ui/app/components/hex-as-decimal-input.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui/app/components/hex-as-decimal-input.js') diff --git a/ui/app/components/hex-as-decimal-input.js b/ui/app/components/hex-as-decimal-input.js index e37aaa8c3..d24fdcb7b 100644 --- a/ui/app/components/hex-as-decimal-input.js +++ b/ui/app/components/hex-as-decimal-input.js @@ -139,7 +139,7 @@ HexAsDecimalInput.prototype.constructWarning = function () { } function hexify (decimalString) { - const hexBN = new BN(decimalString, 10) + const hexBN = new BN(decimalString.split('.')[0], 10) return '0x' + hexBN.toString('hex') } -- cgit From 7e7ceab95edcf27a240da478a1f5da2d97cd5e85 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 17 May 2017 14:31:06 -0700 Subject: Fix decimal tolerance --- ui/app/components/hex-as-decimal-input.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui/app/components/hex-as-decimal-input.js') diff --git a/ui/app/components/hex-as-decimal-input.js b/ui/app/components/hex-as-decimal-input.js index d24fdcb7b..4a71e9585 100644 --- a/ui/app/components/hex-as-decimal-input.js +++ b/ui/app/components/hex-as-decimal-input.js @@ -139,7 +139,7 @@ HexAsDecimalInput.prototype.constructWarning = function () { } function hexify (decimalString) { - const hexBN = new BN(decimalString.split('.')[0], 10) + const hexBN = new BN(parseInt(decimalString), 10) return '0x' + hexBN.toString('hex') } -- cgit