mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-06-27 13:11:43 +02:00
Use the approximation sign for rounded imaginary numbers
This commit is contained in:
parent
d9a63396d6
commit
27e3c510f9
@ -51,7 +51,7 @@ impl CalculationResult {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let decimal_count = if let Some(dot_index) = value.chars().position(|c| c == '.') {
|
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 }
|
if end_index > dot_index { end_index - dot_index } else { 0 }
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user