diff --git a/core/expression/src/variable/conv.rs b/core/expression/src/variable/conv.rs index 2de12db1..8caeb15b 100644 --- a/core/expression/src/variable/conv.rs +++ b/core/expression/src/variable/conv.rs @@ -56,7 +56,9 @@ impl From for Value { match value { Variable::Null => Value::Null, Variable::Bool(b) => Value::Bool(b), - Variable::Number(n) => Value::Number(Number::from_string_unchecked(n.to_string())), + Variable::Number(n) => { + Value::Number(Number::from_string_unchecked(n.normalize().to_string())) + } Variable::String(s) => Value::String(s.to_string()), Variable::Array(arr) => { let vec = Rc::try_unwrap(arr) diff --git a/core/expression_repl/src/main.rs b/core/expression_repl/src/main.rs index 1d3c7873..69ca6759 100644 --- a/core/expression_repl/src/main.rs +++ b/core/expression_repl/src/main.rs @@ -12,7 +12,7 @@ trait PrettyPrint { impl PrettyPrint for Variable { fn pretty_print(&self) -> String { match &self { - Variable::Number(num) => format!("{}", num.to_string().yellow()), + Variable::Number(num) => format!("{}", num.normalize().to_string().yellow()), Variable::String(str) => format!("{}", format!("'{}'", str).green()), Variable::Bool(b) => format!("{}", b.to_string().yellow()), Variable::Null => format!("{}", "null".bold()),