parse_ether_value

Function parse_ether_value 

Source
pub fn parse_ether_value(value: &str) -> Result<u128>
Expand description

Parses an ether value from a string.

The amount in eth like “1.05” will be interpreted in wei (1.05 * 1e18). Supports both decimal and integer inputs.

§Examples

  • “1.05” -> 1.05 ETH = 1.05 * 10^18 wei
  • “2” -> 2 ETH = 2 * 10^18 wei