mirror of
https://github.com/PaddiM8/kalker.git
synced 2024-11-08 00:44:40 +01:00
Fixed zeroes being trimmed for non-rug numbers
This commit is contained in:
parent
277b1ed4c0
commit
d5c991ffdf
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -127,7 +127,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kalk"
|
||||
version = "1.4.3"
|
||||
version = "1.4.4"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"regex",
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "kalk"
|
||||
version = "1.4.3"
|
||||
version = "1.4.4"
|
||||
authors = ["PaddiM8"]
|
||||
edition = "2018"
|
||||
readme = "README.md"
|
||||
|
@ -51,11 +51,15 @@ impl KalkNum {
|
||||
|
||||
#[wasm_bindgen(js_name = toString)]
|
||||
pub fn to_string(&self) -> String {
|
||||
self.value
|
||||
.to_string()
|
||||
.trim_end_matches('0')
|
||||
.trim_end_matches('.')
|
||||
.to_string()
|
||||
let string_value = self.value.to_string();
|
||||
if string_value.contains(".") {
|
||||
string_value
|
||||
.trim_end_matches('0')
|
||||
.trim_end_matches('.')
|
||||
.to_string()
|
||||
} else {
|
||||
string_value
|
||||
}
|
||||
}
|
||||
|
||||
#[wasm_bindgen(js_name = toStringBig)]
|
||||
|
Loading…
Reference in New Issue
Block a user