{"action":"reopened","issue":{"url":"https://api.github.com/repos/ethers-io/ethers.js/issues/228","repository_url":"https://api.github.com/repos/ethers-io/ethers.js","labels_url":"https://api.github.com/repos/ethers-io/ethers.js/issues/228/labels{/name}","comments_url":"https://api.github.com/repos/ethers-io/ethers.js/issues/228/comments","events_url":"https://api.github.com/repos/ethers-io/ethers.js/issues/228/events","html_url":"https://github.com/ethers-io/ethers.js/issues/228","id":340513594,"node_id":"MDU6SXNzdWUzNDA1MTM1OTQ=","number":228,"title":"Discussion: Support scientific notation in BigNumbers?","user":{"login":"ricmoo","id":975687,"node_id":"MDQ6VXNlcjk3NTY4Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/975687?v=4","gravatar_id":"","url":"https://api.github.com/users/ricmoo","html_url":"https://github.com/ricmoo","followers_url":"https://api.github.com/users/ricmoo/followers","following_url":"https://api.github.com/users/ricmoo/following{/other_user}","gists_url":"https://api.github.com/users/ricmoo/gists{/gist_id}","starred_url":"https://api.github.com/users/ricmoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ricmoo/subscriptions","organizations_url":"https://api.github.com/users/ricmoo/orgs","repos_url":"https://api.github.com/users/ricmoo/repos","events_url":"https://api.github.com/users/ricmoo/events{/privacy}","received_events_url":"https://api.github.com/users/ricmoo/received_events","type":"User","site_admin":false},"labels":[{"id":409075434,"node_id":"MDU6TGFiZWw0MDkwNzU0MzQ=","url":"https://api.github.com/repos/ethers-io/ethers.js/labels/discussion","name":"discussion","color":"c5def5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-07-12T07:05:25Z","updated_at":"2018-09-23T18:37:58Z","closed_at":null,"author_association":"MEMBER","body":"This came up [recently](https://github.com/ethers-io/ethers.js/issues/219), and so I thought I would open it up for discussion.\r\n\r\nPros:\r\n\r\n- Very common values are easier and less prone to bugs to enter (e.g. \"1e18\"); these are already available as `ethers.constants.WeiPerEther`, but other common values may come up too, such as `1e9` referring to wei per gwei.\r\n- Nice feature to have\r\n\r\nCons:\r\n\r\n- Yes another way string values can be confused for hexadecimal values (`1e18` is 7704 in hex); this may be less an issue, since hexadecimal strings **must** begin with a `0x` prefix, and currently this is already a problem if people try `19`, meaning `0x19`, which is 25\r\n- This might encourage the use of scientific notation in newer developers, which would be confused by the numeric overflow; for example `bigNumberify((1e18 + 65) - (1e18 + 64))`; the underflow occurs before we have a chance to catch it; this is already still an issue though\r\n- This may require slightly more complicated code than is immediately obvious and will require substantial testing\r\n\r\nAnyways, please anyone else please feel free to add, augment or refute any points."}}
{"actor":{"display_login":"ricmoo"}}