Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Moritz Sokoll
btui-rs
Commits
f5966536
Verified
Commit
f5966536
authored
Oct 27, 2021
by
Moritz Sokoll
🦀
Browse files
pbar: now rounding to two decimal spaces for displaying
parent
22eeeb71
Pipeline
#320
passed with stages
in 31 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Cargo.toml
View file @
f5966536
[package]
name
=
"btui"
version
=
"0.6.
8
"
version
=
"0.6.
9
"
edition
=
"2018"
authors
=
[
"Moritz Sokoll <moritz@sokoll.com>"
]
license
=
"MIT"
...
...
src/pbar.rs
View file @
f5966536
...
...
@@ -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
)
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment