Used fixed notation, rather than the classic Math.round() rounding idiom.
This commit is contained in:
1 parent
a902155a59
commit
6efb7b8bde
1 file changed
+3
-3
@@ -776,13 +776,13 @@ GuacUI.Client.attach = function(guac) {
|
|||||||
function getSizeString(bytes) {
|
function getSizeString(bytes) {
|
||||||
|
|
||||||
if (bytes > 1000000000)
|
if (bytes > 1000000000)
|
||||||
return Math.round(bytes / 100000000)/10 + " GB";
|
return (bytes / 1000000000).toFixed(1) + " GB";
|
||||||
|
|
||||||
else if (bytes > 1000000)
|
else if (bytes > 1000000)
|
||||||
return Math.round(bytes / 100000)/10 + " MB";
|
return (bytes / 1000000).toFixed(1) + " MB";
|
||||||
|
|
||||||
else if (bytes > 1000)
|
else if (bytes > 1000)
|
||||||
return Math.round(bytes / 100)/10 + " KB";
|
return (bytes / 1000).toFixed(1) + " KB";
|
||||||
|
|
||||||
else
|
else
|
||||||
return bytes + " B";
|
return bytes + " B";
|
||||||
|
|||||||
Reference in new issue
Block a user