Function ethers_core::utils::format_ether
source · pub fn format_ether<T: Into<ParseUnits>>(amount: T) -> String
Expand description
Format the output for the user which prefer to see values in ether (instead of wei)
Divides the input by 1e18
use ethers_core::{types::U256, utils::format_ether};
let eth = format_ether(1395633240123456000_u128);
assert_eq!(eth.parse::<f64>().unwrap(), 1.395633240123456);