summaryrefslogtreecommitdiffstats
path: root/src/display/components/display_bandwidth.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/display/components/display_bandwidth.rs')
-rw-r--r--src/display/components/display_bandwidth.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/display/components/display_bandwidth.rs b/src/display/components/display_bandwidth.rs
index dcc204c..04f1e89 100644
--- a/src/display/components/display_bandwidth.rs
+++ b/src/display/components/display_bandwidth.rs
@@ -8,7 +8,9 @@ pub struct DisplayBandwidth {
impl fmt::Display for DisplayBandwidth {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let suffix = if self.as_rate { "ps" } else { "" };
- if self.bandwidth > 999_999_999.0 {
+ if self.bandwidth > 999_999_999_999.0 {
+ write!(f, "{:.2}TB{}", self.bandwidth / 1_000_000_000_000.0, suffix)
+ } else if self.bandwidth > 999_999_999.0 {
write!(f, "{:.2}GB{}", self.bandwidth / 1_000_000_000.0, suffix)
} else if self.bandwidth > 999_999.0 {
write!(f, "{:.2}MB{}", self.bandwidth / 1_000_000.0, suffix)