refactor(formatting): remove unneeded logic
This commit is contained in:
parent
42692d3ae4
commit
f60c8749a0
1 changed files with 1 additions and 13 deletions
|
|
@ -11,19 +11,7 @@ pub fn pretty_eval(input: &str, max_digits: usize) -> Result<String, Error> {
|
|||
let should_add_back_backslash = input.contains('\\');
|
||||
|
||||
let result = nodes::eval(&input)?;
|
||||
let display_digits = get_significant_digits(&result).clamp(
|
||||
if result >= 1000 || result < 1 {
|
||||
1
|
||||
} else if result >= 100 {
|
||||
3
|
||||
} else if result >= 10 {
|
||||
2
|
||||
// if result >= 1
|
||||
} else {
|
||||
1
|
||||
},
|
||||
max_digits,
|
||||
);
|
||||
let display_digits = get_significant_digits(&result).clamp(1, max_digits);
|
||||
|
||||
let mut changing_string = format!("{result:.display_digits$}");
|
||||
if let Some(index) = changing_string.find('e')
|
||||
|
|
|
|||
Loading…
Reference in a new issue