Skip to content

Commit

Permalink
Trimming zeroes at the start of scientific notation, and scientific n…
Browse files Browse the repository at this point in the history
…otation exponent value fix
  • Loading branch information
PaddiM8 committed Dec 13, 2020
1 parent 318e8b8 commit bd86091
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion kalk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kalk"
version = "1.2.3"
version = "1.2.4"
authors = ["PaddiM8"]
edition = "2018"
readme = "README.md"
Expand Down
3 changes: 2 additions & 1 deletion kalk/src/kalk_num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down Expand Up @@ -74,6 +74,7 @@ impl KalkNum {
ScientificNotation {
negative: neg,
digits: digits
.trim_start_matches('0')
.trim_end_matches('0')
.trim_end_matches('.')
.to_string(),
Expand Down
4 changes: 2 additions & 2 deletions kalk_cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kalk_cli"
version = "0.3.5"
version = "0.3.6"
authors = ["PaddiM8"]
edition = "2018"
readme = "../README.md"
Expand All @@ -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"
Expand Down

0 comments on commit bd86091

Please sign in to comment.