-
I use this version: My code: <script type="module">
import { ethers } from "./ethers-5.5.4.esm.min.js";
console.log(ethers.utils.hexlify(1000000000000000000));
</script> I get this error:
|
Beta Was this translation helpful? Give feedback.
Answered by
ricmoo
Mar 8, 2022
Replies: 1 comment 1 reply
-
Please read the note on IEEE 754 for more info on using numbers in JavaScript. For your purposes, you would probably want to use |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
NabiKAZ
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please read the note on IEEE 754 for more info on using numbers in JavaScript.
For your purposes, you would probably want to use
BigNumber.from("1000000000000000000").toHexString()
. Notice it is a string, which is safe for large values in JavaScript.