Skip to content

Commit

Permalink
Merge pull request #362 from hatoo/format-byte-unit
Browse files Browse the repository at this point in the history
Fix byte-unit format
  • Loading branch information
hatoo authored Jan 4, 2024
2 parents b1e55f3 + 77f2a43 commit 16d1df8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ impl Monitor {
Style::default().fg(colors.light_blue.unwrap_or(Color::Reset)),
)]),
Line::from(format!(
"Data: {}",
"Data: {:.2}",
Byte::from_u64(
last_1_timescale
.iter()
Expand Down
6 changes: 3 additions & 3 deletions src/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,12 @@ fn print_summary<W: Write, E: std::fmt::Display>(
writeln!(w)?;
writeln!(
w,
" Total data:\t{}",
" Total data:\t{:.2}",
Byte::from_u64(calculate_total_data(res)).get_appropriate_unit(byte_unit::UnitType::Binary)
)?;
writeln!(
w,
" Size/request:\t{}",
" Size/request:\t{:.2}",
(calculate_size_per_request(res))
.map(|n| Byte::from_u64(n)
.get_appropriate_unit(byte_unit::UnitType::Binary)
Expand All @@ -411,7 +411,7 @@ fn print_summary<W: Write, E: std::fmt::Display>(
)?;
writeln!(
w,
" Size/sec:\t{}",
" Size/sec:\t{:.2}",
Byte::from_u64((calculate_size_per_sec(res, total_duration)) as u64)
.get_appropriate_unit(byte_unit::UnitType::Binary)
)?;
Expand Down

0 comments on commit 16d1df8

Please sign in to comment.