Verified Commit f5966536 authored by Moritz Sokoll's avatar Moritz Sokoll 🦀
Browse files

pbar: now rounding to two decimal spaces for displaying

parent 22eeeb71
Pipeline #320 passed with stages
in 31 seconds
[package]
name = "btui"
version = "0.6.8"
version = "0.6.9"
edition = "2018"
authors = ["Moritz Sokoll <moritz@sokoll.com>"]
license = "MIT"
......
......@@ -53,7 +53,7 @@ impl ProgressBar {
bar.push_str(format!("{}", self.empty).as_str());
idx += 1;
}
format!("{}: [{}] {}%", self.text.clone(), bar, self.progress)
format!("{}: [{}] {:.2}%", self.text.clone(), bar, self.progress)
}
}
......@@ -118,7 +118,7 @@ impl ExtProgressBar {
idx += 1;
}
format!(
"{}: {}{}{} {}%",
"{}: {}{}{} {:.2}%",
self.text, begin, bar, close, self.progress
)
}
......@@ -150,7 +150,7 @@ impl ExtProgressBar {
idx += 1;
}
format!(
"{}: {}{}{} {}%",
"{}: {}{}{} {:.2}%",
self.text, begin, bar, close, self.progress
)
}
......@@ -173,7 +173,7 @@ impl ExtProgressBar {
bar.push(' ');
idx += 1;
}
format!("{}: [{}] {}%", self.text, bar, self.progress)
format!("{}: [{}] {:.2}%", self.text, bar, self.progress)
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment