From 61dfe739d5be22153fa05ec63af8dc5401cf64b2 Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Thu, 9 Apr 2020 01:19:36 +0200 Subject: [PATCH] net: allow shortening of linespeed to Gbit/s --- src/adapters/net.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adapters/net.cpp b/src/adapters/net.cpp index 40c8b89f..97fafb14 100644 --- a/src/adapters/net.cpp +++ b/src/adapters/net.cpp @@ -308,7 +308,7 @@ namespace net { * about the current connection */ string wired_network::linkspeed() const { - return m_linkspeed == -1 ? "N/A" : (to_string(m_linkspeed) + " Mbit/s"); + return m_linkspeed == -1 ? "N/A" : (m_linkspeed < 1000 ? (to_string(m_linkspeed) + " Mbit/s") : (to_string(m_linkspeed / 1000) + " Gbit/s")); } // }}}