mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-01-05 21:18:59 +01:00
Trimming zeroes at the start of scientific notation, and scientific notation exponent value fix
This commit is contained in:
parent
9212581ebd
commit
98014166a9
4
Cargo.lock
generated
4
Cargo.lock
generated
@ -153,7 +153,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "kalk"
|
name = "kalk"
|
||||||
version = "1.2.3"
|
version = "1.2.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"regex",
|
"regex",
|
||||||
@ -163,7 +163,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "kalk_cli"
|
name = "kalk_cli"
|
||||||
version = "0.3.5"
|
version = "0.3.6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ansi_term",
|
"ansi_term",
|
||||||
"kalk",
|
"kalk",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "kalk"
|
name = "kalk"
|
||||||
version = "1.2.3"
|
version = "1.2.4"
|
||||||
authors = ["PaddiM8"]
|
authors = ["PaddiM8"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
@ -25,7 +25,7 @@ impl ScientificNotation {
|
|||||||
digits_and_mul.insert(1usize, '.');
|
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 {
|
ScientificNotation {
|
||||||
negative: neg,
|
negative: neg,
|
||||||
digits: digits
|
digits: digits
|
||||||
|
.trim_start_matches('0')
|
||||||
.trim_end_matches('0')
|
.trim_end_matches('0')
|
||||||
.trim_end_matches('.')
|
.trim_end_matches('.')
|
||||||
.to_string(),
|
.to_string(),
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "kalk_cli"
|
name = "kalk_cli"
|
||||||
version = "0.3.5"
|
version = "0.3.6"
|
||||||
authors = ["PaddiM8"]
|
authors = ["PaddiM8"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
readme = "../README.md"
|
readme = "../README.md"
|
||||||
@ -16,7 +16,7 @@ path = "src/main.rs"
|
|||||||
name = "kalk"
|
name = "kalk"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
kalk = { path = "../kalk", version = "^1.2.3" }
|
kalk = { path = "../kalk", version = "^1.2.4" }
|
||||||
rustyline = "7.0.0"
|
rustyline = "7.0.0"
|
||||||
ansi_term = "0.12"
|
ansi_term = "0.12"
|
||||||
regex = "1"
|
regex = "1"
|
||||||
|
Loading…
Reference in New Issue
Block a user