Skip to content

Default read functionality change to decimal #2533

Answered by ricmoo
johnfrades asked this question in Q&A
Discussion options

You must be logged in to vote

No, there is nothing built into ethers to globally change the return value. Otherwise a lot of code would become very difficult to rely on (for example, structs and other noted structures). This would also break encapsulation (e.g. imagine if a library accepts a contract to do stuff with it, it would now start receiving strings instead of BigNumbers, so it would crash or do wrong things).

You could sub-class Contract, and change the abider it uses, but this is a lot of effort just to save a few toString(). :s

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@johnfrades
Comment options

Answer selected by johnfrades
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants