Skip to content

Commit

Permalink
Fix byte-unit format
Browse files Browse the repository at this point in the history
  • Loading branch information
hatoo committed Jan 4, 2024
1 parent b1e55f3 commit 77f2a43
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 77f2a43

Please sign in to comment.