Fix: connection overlap on English

This commit is contained in:
Dreamacro 2022-05-29 21:41:40 +08:00
parent a46ac3456f
commit 13fa9b96bb
2 changed files with 3 additions and 3 deletions

View File

@ -85,8 +85,8 @@ const EN = {
dstIP: 'IP',
dstIPEmpty: 'Empty',
srcIP: 'Source',
upload: 'Upload',
download: 'Download',
upload: 'Up',
download: 'Down',
network: 'Network',
process: 'Process',
processPath: 'Path',

View File

@ -13,7 +13,7 @@ export function partition<T> (arr: T[], fn: (arg: T) => boolean): [T[], T[]] {
}
export function formatTraffic (num: number) {
const s = ['B', 'KB', 'MB', 'GB', 'TB']
const s = ['B', 'KiB', 'MiB', 'GiB', 'TiB']
const exp = Math.floor(Math.log(num || 1) / Math.log(1024))
return `${floor(num / Math.pow(1024, exp), 2).toFixed(2)} ${s?.[exp] ?? ''}`
}