MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / formatBytes

Function formatBytes

nezha/nezha.ts:127–133  ·  view source on GitHub ↗
(bytes: number)

Source from the content-addressed store, hash-verified

125 return (bytes / Math.pow(k, i)).toFixed(2) + " " + sizes[i];
126}
127
128function formatSpeed(bytes: number): string {
129 return formatBytes(bytes) + "/s";
130}
131
132function formatUptime(seconds: number): string {
133 const days = Math.floor(seconds / 86400);
134 const hours = Math.floor((seconds % 86400) / 3600);
135 const minutes = Math.floor((seconds % 3600) / 60);
136 const parts: string[] = [];

Callers 2

formatSpeedFunction · 0.70
formatServerInfoFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected