pub fn format_ether<T: Into<ParseUnits>>(amount: T) -> String
Expand description
Formats the given number of Wei as an Ether amount.
ยงExamples
use alloy_primitives::{U256, utils::format_ether};
let eth = format_ether(1395633240123456000_u128);
assert_eq!(format_ether(1395633240123456000_u128), "1.395633240123456000");