{"ScriptPreparationCode":" function formatSize0(sizeBytes) {\r\n if (sizeBytes === 0) {\r\n return \u00220\u0022;\r\n }\r\n\r\n if (sizeBytes === 0) {\r\n return \u00220\u0022;\r\n }\r\n\r\n const kbyte = 1024;\r\n const mbyte = 1048576;\r\n const gbyte = 1073741824;\r\n const tbyte = 1099511627776;\r\n \r\n if (sizeBytes \u003E tbyte) {\r\n return \u0060${(sizeBytes / tbyte).toFixed(2)} TiB\u0060;\r\n } else if (sizeBytes \u003E gbyte) {\r\n return \u0060${(sizeBytes / gbyte).toFixed(2)} GiB\u0060;\r\n } else if (sizeBytes \u003E mbyte) {\r\n return \u0060${(sizeBytes / mbyte).toFixed(2)} MiB\u0060;\r\n } else if (sizeBytes \u003E kbyte) {\r\n return \u0060${(sizeBytes / kbyte).toFixed(2)} KiB\u0060;\r\n } else {\r\n return \u0022\u0022 \u002B sizeBytes;\r\n }\r\n }\r\n\r\n function formatSize1(sizeBytes) {\r\n if (sizeBytes === 0) {\r\n return \u00220\u0022;\r\n }\r\n\r\n const kbyte = 1024;\r\n const formats = [\u0022\u0022, \u0022KiB\u0022, \u0022MiB\u0022, \u0022GiB\u0022, \u0022TiB\u0022, \u0022PiB\u0022, \u0022EiB\u0022, \u0022ZiB\u0022, \u0022YiB\u0022];\r\n\r\n const formatIndex = Math.floor(Math.log(sizeBytes) / Math.log(kbyte));\r\n\r\n return \u0060${parseFloat((sizeBytes / kbyte ** formatIndex).toFixed(2))} ${formats[formatIndex]}\u0060;\r\n }","TestCases":[{"Name":"Format 0","Code":"formatSize0(477393);\r\nformatSize0(329842980);\r\nformatSize0(20);\r\nformatSize0(23908423904829022);\r\nformatSize0(3156212643);","IsDeferred":false},{"Name":"Format 1","Code":"formatSize1(477393);\r\nformatSize1(329842980);\r\nformatSize1(20);\r\nformatSize1(23908423904829022);\r\nformatSize1(3156212643);","IsDeferred":false}]}