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