From 09f633596da91818201781cc009e1e1ab6f8d059 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Tue, 27 Jan 2015 15:20:22 +0100 Subject: fixed #23 --- lib/web3.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/web3.js') diff --git a/lib/web3.js b/lib/web3.js index 7cf624c9c..622be29b6 100644 --- a/lib/web3.js +++ b/lib/web3.js @@ -233,7 +233,9 @@ var web3 = { /// @returns decimal representaton of hex value prefixed by 0x toDecimal: function (val) { - return (new BigNumber(val.substring(2), 16).toString(10)); + // remove 0x and place 0, if it's required + val = val.length > 2 ? val.substring(2) : "0"; + return (new BigNumber(val, 16).toString(10)); }, /// @returns hex representation (prefixed by 0x) of decimal value -- cgit v1.2.3 From c2cb2bef96e591d68b04cf5f1a6ec29696abb481 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Tue, 27 Jan 2015 16:02:42 +0100 Subject: removed web3.eth.account, fixed #37 --- lib/web3.js | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/web3.js') diff --git a/lib/web3.js b/lib/web3.js index 622be29b6..7b8bbd28a 100644 --- a/lib/web3.js +++ b/lib/web3.js @@ -98,7 +98,6 @@ var ethProperties = function () { { name: 'listening', getter: 'eth_listening', setter: 'eth_setListening' }, { name: 'mining', getter: 'eth_mining', setter: 'eth_setMining' }, { name: 'gasPrice', getter: 'eth_gasPrice' }, - { name: 'account', getter: 'eth_account' }, { name: 'accounts', getter: 'eth_accounts' }, { name: 'peerCount', getter: 'eth_peerCount' }, { name: 'defaultBlock', getter: 'eth_defaultBlock', setter: 'eth_setDefaultBlock' }, -- cgit v1.2.3