Function invert_price
pub fn invert_price(price: f64, decimals_a: u8, decimals_b: u8) -> f64Expand description
Invert a price IMPORTANT: floating point operations can reduce the precision of the result. Make sure to do these operations last and not to use the result for further calculations.
§Parameters
price- The price to invertdecimals_a- The number of decimals of the base tokendecimals_b- The number of decimals of the quote token
§Returns
f64- The inverted price