diff --git a/src/formatting.rs b/src/formatting.rs index eb097c0..dad87e5 100644 --- a/src/formatting.rs +++ b/src/formatting.rs @@ -2,7 +2,9 @@ use rug::Float; use crate::nodes::{self, Error}; -pub fn pretty_eval(mut input: String, max_digits: usize) -> Result { +pub fn pretty_eval(input: &str, max_digits: usize) -> Result { + let mut input = input.replace('_', ""); + // no need to remove the characters here, // as we ignore the them in all other logic already let should_add_back_alignment = input.contains('&'); @@ -49,20 +51,20 @@ pub fn pretty_eval(mut input: String, max_digits: usize) -> Result usize { diff --git a/src/main.rs b/src/main.rs index c3349d2..c9634da 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,7 +17,7 @@ fn main() -> ExitCode { buf }); - match lib::formatting::pretty_eval(input, 10) { + match lib::formatting::pretty_eval(&input, 10) { Ok(s) => println!("{s}"), Err(e) => {