($size)
| 38 | }; |
| 39 | |
| 40 | function formatBytes($size) { |
| 41 | var $units = [" B", " KB", " MB", " GB", " TB"]; |
| 42 | |
| 43 | for ($i = 0; $size >= 1024 && $i < 4; $i++) $size /= 1024; |
| 44 | |
| 45 | return $size.toFixed(2) + $units[$i]; |
| 46 | } |
| 47 | |
| 48 | //将json字符串解析成json对象 |
| 49 | function parseJson(obj) { |
nothing calls this directly
no outgoing calls
no test coverage detected