From 7a391b529843977d2a43921ece904242cc351e59 Mon Sep 17 00:00:00 2001 From: dzmitry-lahoda Date: Tue, 9 Apr 2024 13:45:35 +0100 Subject: [PATCH] float... --- crates/cvm/src/asset.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/cvm/src/asset.rs b/crates/cvm/src/asset.rs index 9f90f1c8..4fe526ff 100644 --- a/crates/cvm/src/asset.rs +++ b/crates/cvm/src/asset.rs @@ -179,11 +179,11 @@ impl Amount { // with rounding to reduce or reduce down part up to some seven bit parts pub const MAX_PARTS: u64 = 1_000_000_000_000_000_000; - #[cfg(not(feature = "cosmwasm"))] - pub fn try_floor_f64(value: f64) -> Result { + #[cfg(feature = "native")] + pub fn try_floor_ratio(value: Ratio) -> Result { if value < 0.0 || value.is_nan() { Err(ArithmeticError::Underflow) - } else if value > u128::MAX as f64 { + } else if value > u128::MAX { Err(ArithmeticError::Underflow) } else { Ok((value as u128).into())