From 27e3c510f9c406864032398df70f058dd10d1330 Mon Sep 17 00:00:00 2001 From: PaddiM8 Date: Wed, 3 Apr 2024 17:27:25 +0200 Subject: [PATCH] Use the approximation sign for rounded imaginary numbers --- kalk/src/calculation_result.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kalk/src/calculation_result.rs b/kalk/src/calculation_result.rs index 459c5d2..7a7cf4e 100644 --- a/kalk/src/calculation_result.rs +++ b/kalk/src/calculation_result.rs @@ -51,7 +51,7 @@ impl CalculationResult { }; let decimal_count = if let Some(dot_index) = value.chars().position(|c| c == '.') { - let end_index = value.chars().position(|c| c == ' ').unwrap_or(value.len()) - 1; + let end_index = value.chars().position(|c| c == ' ' || c == 'i').unwrap_or(value.len()) - 1; if end_index > dot_index { end_index - dot_index } else { 0 } } else {