diff --git a/web/assets/css/transmission-app.scss b/web/assets/css/transmission-app.scss index 1386156ee..17b0feb13 100644 --- a/web/assets/css/transmission-app.scss +++ b/web/assets/css/transmission-app.scss @@ -409,8 +409,8 @@ a { align-items: inherit; flex-direction: inherit; - &:not(:nth-child(1 of #mainwin-statusbar .speed-container)) { - width: 100px; + + .speed-container { + min-width: 100px; } } diff --git a/web/src/formatter.js b/web/src/formatter.js index 7389ae908..f7484f860 100644 --- a/web/src/formatter.js +++ b/web/src/formatter.js @@ -51,6 +51,11 @@ const fmt_MBps = new Intl.NumberFormat(current_locale, { style: 'unit', unit: 'megabyte-per-second', }); +const fmt_GBps = new Intl.NumberFormat(current_locale, { + maximumFractionDigits: 2, + style: 'unit', + unit: 'gigabyte-per-second', +}); export const Formatter = { /** Round a string of a number to a specified number of decimal places */ @@ -122,7 +127,12 @@ export const Formatter = { }, speed(KBps) { - return KBps < 999.95 ? fmt_kBps.format(KBps) : fmt_MBps.format(KBps / 1000); + if (KBps < 999.95) { + return fmt_kBps.format(KBps); + } else if (KBps < 999_950) { + return fmt_MBps.format(KBps / 1000); + } + return fmt_GBps.format(KBps / 1_000_000); }, speedBps(Bps) {