diff --git a/src/helpers.rs b/src/helpers.rs index e1c2804..4ff5eca 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -110,7 +110,7 @@ pub(crate) fn convert_increment_to_precision(increment: rust_decimal::Decimal) - let mut precision = 0; let mut incr = increment; - while incr != rust_decimal::Decimal::from(1) { + while incr < rust_decimal::Decimal::from(1) { incr *= rust_decimal::Decimal::from(10); precision += 1; } diff --git a/src/main.rs b/src/main.rs index 756eb56..a230040 100644 --- a/src/main.rs +++ b/src/main.rs @@ -72,7 +72,8 @@ async fn main() { // Set precision for price let price_precision = helpers::convert_increment_to_precision( - future_result.price_increment); + future_result.price_increment + ); // Set precision for order