mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 02:18:42 +00:00
fix: utilize gigabyte per second to conserve space and upload arrow clipping fix (#7279)
* Update transmission-app.scss * Update formatter.js * Update formatter.js
This commit is contained in:
@@ -409,8 +409,8 @@ a {
|
|||||||
align-items: inherit;
|
align-items: inherit;
|
||||||
flex-direction: inherit;
|
flex-direction: inherit;
|
||||||
|
|
||||||
&:not(:nth-child(1 of #mainwin-statusbar .speed-container)) {
|
+ .speed-container {
|
||||||
width: 100px;
|
min-width: 100px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,11 @@ const fmt_MBps = new Intl.NumberFormat(current_locale, {
|
|||||||
style: 'unit',
|
style: 'unit',
|
||||||
unit: 'megabyte-per-second',
|
unit: 'megabyte-per-second',
|
||||||
});
|
});
|
||||||
|
const fmt_GBps = new Intl.NumberFormat(current_locale, {
|
||||||
|
maximumFractionDigits: 2,
|
||||||
|
style: 'unit',
|
||||||
|
unit: 'gigabyte-per-second',
|
||||||
|
});
|
||||||
|
|
||||||
export const Formatter = {
|
export const Formatter = {
|
||||||
/** Round a string of a number to a specified number of decimal places */
|
/** Round a string of a number to a specified number of decimal places */
|
||||||
@@ -122,7 +127,12 @@ export const Formatter = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
speed(KBps) {
|
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) {
|
speedBps(Bps) {
|
||||||
|
|||||||
Reference in New Issue
Block a user