Skip to content

Commit

Permalink
fix(view): display 1000 Mb/s as 1 Gb/s
Browse files Browse the repository at this point in the history
  • Loading branch information
MauriceNino committed Feb 1, 2023
1 parent 7f5186e commit a36aff0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/view/src/utils/calculations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ export const toCommas = (num: number, commas = 1): number => {
};

export const bpsPrettyPrint = (bits: number) => {
return bits > 1000 * 1000 * 1000
return bits >= 1000 * 1000 * 1000
? `${(bits / 1000 / 1000 / 1000).toFixed(1)} Gb/s`
: bits > 1000 * 1000
: bits >= 1000 * 1000
? `${(bits / 1000 / 1000).toFixed(1)} Mb/s`
: bits > 1000
: bits >= 1000
? `${(bits / 1000).toFixed(1)} Kb/s`
: `${bits.toFixed(1)} b/s`;
};
Expand Down

0 comments on commit a36aff0

Please sign in to comment.