1 2 3 4 5 6 7 8 9 10 11 12 13 14
// src/utils/maths.rs // author: steinkirch use web3::types::{U256}; pub fn wei_to_eth(wei_val: U256) -> f64 { let res = wei_val.as_u128() as f64; res / 1_000_000_000_000_000_000.0 }