This commit is contained in:
Panayiotis Lipiridis 2021-02-07 14:38:15 +02:00
parent dc95cf3447
commit 6540c5460e
4 changed files with 75 additions and 75 deletions

View file

@ -363,9 +363,9 @@ export const nFormatter = (num: number, digits: number): string => {
);
};
export const formatSpeedBytes = (speed: number): string => {
// source: en.wikipedia.org/wiki/Data-rate_units#Conversion_table
const suffix = ["B/s", "kB/s", "MB/s", "GB/s"];
export const formatSpeedBits = (speed: number): string => {
// source: https://en.wikipedia.org/wiki/Data-rate_units#Conversion_table
const suffix = ["bit/s", "kbit/s", "Mbit/s", "Gbit/s"];
let index = 0;
while (speed > 1000) {
index++;