Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

convert string in ethers.js

import ethers from 'ethers'
// If a user enters a string in an input field, you may need
// to convert it from ether (as a string) to wei (as a BigNumber)
ethers.utils.parseEther("inputString")
// { BigNumber: "1000000000000000000" }
Source by docs.ethers.io #
 
PREVIOUS NEXT
Tagged: #convert #string
ADD COMMENT
Topic
Name
1+8 =