Skip to content

Commit

Permalink
Add a space between numbers and their units
Browse files Browse the repository at this point in the history
  • Loading branch information
firasuke authored and djc committed Jan 2, 2022
1 parent 0e57b21 commit 8a126b2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/format.rs
Expand Up @@ -106,7 +106,7 @@ impl fmt::Display for HumanBytes {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match NumberPrefix::binary(self.0 as f64) {
NumberPrefix::Standalone(number) => write!(f, "{:.0}B", number),
NumberPrefix::Prefixed(prefix, number) => write!(f, "{:.2}{}B", number, prefix),
NumberPrefix::Prefixed(prefix, number) => write!(f, "{:.2} {}B", number, prefix),
}
}
}
Expand All @@ -115,7 +115,7 @@ impl fmt::Display for DecimalBytes {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match NumberPrefix::decimal(self.0 as f64) {
NumberPrefix::Standalone(number) => write!(f, "{:.0}B", number),
NumberPrefix::Prefixed(prefix, number) => write!(f, "{:.2}{}B", number, prefix),
NumberPrefix::Prefixed(prefix, number) => write!(f, "{:.2} {}B", number, prefix),
}
}
}
Expand All @@ -124,7 +124,7 @@ impl fmt::Display for BinaryBytes {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match NumberPrefix::binary(self.0 as f64) {
NumberPrefix::Standalone(number) => write!(f, "{:.0}B", number),
NumberPrefix::Prefixed(prefix, number) => write!(f, "{:.2}{}B", number, prefix),
NumberPrefix::Prefixed(prefix, number) => write!(f, "{:.2} {}B", number, prefix),
}
}
}
Expand Down

0 comments on commit 8a126b2

Please sign in to comment.