[TIC-Web] fix the Util.bytesToSize 33/119033/1
authorChangHyun Lee <leechwin.lee@samsung.com>
Wed, 15 Mar 2017 07:50:58 +0000 (16:50 +0900)
committerChangHyun Lee <leechwin.lee@samsung.com>
Wed, 15 Mar 2017 07:50:58 +0000 (16:50 +0900)
- Consider if bytes is a character

Change-Id: I8dfa4eadfd4324af545ac7c93ef1fd3510d8f890
Signed-off-by: ChangHyun Lee <leechwin.lee@samsung.com>
public/src/js/util.js

index 2a6fcd5..c83d5dc 100644 (file)
@@ -99,7 +99,7 @@ define([
 
     function bytesToSize(bytes) {
         var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
-        if (bytes === 0) {
+        if (bytes === 0 || bytes === '0') {
             return '0 Byte';
         }
         var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));