fix: 字节转换工具

This commit is contained in:
TsMask
2024-01-31 18:47:00 +08:00
parent e552ce89be
commit 4ccd0d080c

View File

@@ -151,13 +151,12 @@ export function parseSizeFromKbs(sizeByte: number, timeInterval: number): any {
/**
* 字节数转换单位
* @param bits 比特b大小
* @param bits 字节Bit大小
* @returns MB
*/
export function parseSizeFromBytes(bits: number | string): string {
bits = Number(bits) || 0;
const byte = bits / 8;
const kb = byte / 1024;
const kb = bits / 1024;
const mb = kb / 1024;
const gb = mb / 1024;
const tb = gb / 1024;