修复: 注释掉位数据转换中的位数乘以8的代码
This commit is contained in:
@@ -178,7 +178,7 @@ export function parseSizeFromKbs(sizeByte: number, timeInterval: number): any {
|
||||
export function parseSizeFromBits(bits: number | string): string {
|
||||
bits = Number(bits) || 0;
|
||||
if (bits <= 0) return '0 B';
|
||||
bits = bits * 8;
|
||||
// bits = bits * 8;
|
||||
const units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
const unitIndex = Math.floor(Math.log2(bits) / 10);
|
||||
const value = bits / Math.pow(1000, unitIndex);
|
||||
|
||||
Reference in New Issue
Block a user