Function ethers_core::utils::parse_ether [−][src]
Expand description
Converts the input to a U256 and converts from Ether to Wei.
use ethers_core::{types::U256, utils::{parse_ether, WEI_IN_ETHER}};
let eth = U256::from(WEI_IN_ETHER);
assert_eq!(eth, parse_ether(1u8).unwrap());
assert_eq!(eth, parse_ether(1usize).unwrap());
assert_eq!(eth, parse_ether("1").unwrap());