Created
November 11, 2024 13:53
-
-
Save Aviksaikat/8ddf760a48b30ee3a057984d3531741f to your computer and use it in GitHub Desktop.
convert U256 to f64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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