Skip to content

Instantly share code, notes, and snippets.

@Aviksaikat
Created November 11, 2024 13:53
Show Gist options
  • Save Aviksaikat/8ddf760a48b30ee3a057984d3531741f to your computer and use it in GitHub Desktop.
Save Aviksaikat/8ddf760a48b30ee3a057984d3531741f to your computer and use it in GitHub Desktop.
convert U256 to f64
use alloy::primitives::U256;
fn main() {
let reserve_ratio: f64 = pool.reserve0.to::<f64>() / pool.reserve1.to::<f64>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment