MCPcopy Create free account
hub / github.com/TruthHun/BookStack / formatBytes

Function formatBytes

static/js/editor.js:223–229  ·  view source on GitHub ↗
($size)

Source from the content-addressed store, hash-verified

221};
222//格式化文件大小
223function formatBytes($size) {
224 var $units = [" B", " KB", " MB", " GB", " TB"];
225
226 for ($i = 0; $size >= 1024 && $i < 4; $i++) $size /= 1024;
227
228 return $size.toFixed(2) + $units[$i];
229}
230
231function uploadImage($id,$callback) {
232 /** 粘贴上传图片 **/

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected