Default read functionality change to decimal #2533
Answered
by
ricmoo
johnfrades
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
ricmoo
Jan 12, 2022
Replies: 1 comment 1 reply
-
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 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
johnfrades
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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