diff --git a/Cargo.lock b/Cargo.lock index 73b74b9..95d3a6c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -153,7 +153,7 @@ dependencies = [ [[package]] name = "kalk" -version = "1.2.3" +version = "1.2.4" dependencies = [ "lazy_static", "regex", @@ -163,7 +163,7 @@ dependencies = [ [[package]] name = "kalk_cli" -version = "0.3.5" +version = "0.3.6" dependencies = [ "ansi_term", "kalk", diff --git a/kalk/Cargo.toml b/kalk/Cargo.toml index 218887a..b648822 100644 --- a/kalk/Cargo.toml +++ b/kalk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kalk" -version = "1.2.3" +version = "1.2.4" authors = ["PaddiM8"] edition = "2018" readme = "README.md" diff --git a/kalk/src/kalk_num.rs b/kalk/src/kalk_num.rs index a5fd1f8..bcba603 100644 --- a/kalk/src/kalk_num.rs +++ b/kalk/src/kalk_num.rs @@ -25,7 +25,7 @@ impl ScientificNotation { digits_and_mul.insert(1usize, '.'); } - format!("{}{}10^{}", sign, digits_and_mul, self.exponent.to_string()) + format!("{}{}10^{}", sign, digits_and_mul, self.exponent - 1) } } @@ -74,6 +74,7 @@ impl KalkNum { ScientificNotation { negative: neg, digits: digits + .trim_start_matches('0') .trim_end_matches('0') .trim_end_matches('.') .to_string(), diff --git a/kalk_cli/Cargo.toml b/kalk_cli/Cargo.toml index 6017b1f..1784fea 100644 --- a/kalk_cli/Cargo.toml +++ b/kalk_cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kalk_cli" -version = "0.3.5" +version = "0.3.6" authors = ["PaddiM8"] edition = "2018" readme = "../README.md" @@ -16,7 +16,7 @@ path = "src/main.rs" name = "kalk" [dependencies] -kalk = { path = "../kalk", version = "^1.2.3" } +kalk = { path = "../kalk", version = "^1.2.4" } rustyline = "7.0.0" ansi_term = "0.12" regex = "1"