fix: 字节转换工具
This commit is contained in:
@@ -151,13 +151,12 @@ export function parseSizeFromKbs(sizeByte: number, timeInterval: number): any {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 字节数转换单位
|
* 字节数转换单位
|
||||||
* @param bits 比特b大小
|
* @param bits 字节Bit大小
|
||||||
* @returns MB
|
* @returns MB
|
||||||
*/
|
*/
|
||||||
export function parseSizeFromBytes(bits: number | string): string {
|
export function parseSizeFromBytes(bits: number | string): string {
|
||||||
bits = Number(bits) || 0;
|
bits = Number(bits) || 0;
|
||||||
const byte = bits / 8;
|
const kb = bits / 1024;
|
||||||
const kb = byte / 1024;
|
|
||||||
const mb = kb / 1024;
|
const mb = kb / 1024;
|
||||||
const gb = mb / 1024;
|
const gb = mb / 1024;
|
||||||
const tb = gb / 1024;
|
const tb = gb / 1024;
|
||||||
|
|||||||
Reference in New Issue
Block a user