diff --git a/class/core/public.py b/class/core/public.py index 83e45bb5a..a22076422 100755 --- a/class/core/public.py +++ b/class/core/public.py @@ -808,12 +808,10 @@ def toSize(size): s = d[0] for b in d: if size < 1024: - return str(size) + ' ' + b + return str(round(size, 2)) + ' ' + b size = size / 1024 s = b - _size = round(size, 2) - print size,_size - return str(size) + ' ' + b + return str(round(size, 2)) + ' ' + b def getMacAddress(): diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index 46854e7a1..8bdd38ec5 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -782,12 +782,11 @@ def toSize(size): s = d[0] for b in d: if size < 1024: - _size = round(size, 2) - print size,_size return str(size) + ' ' + b size = size / 1024 s = b - + _size = round(size, 2) + print size,_size return str(size) + ' ' + b def setDbAccess(): @@ -839,7 +838,8 @@ def getDbInfo(): if not data: data = 0 - ret['data_size'] = toSize(data) + ret['data_size'] = public.toSize(data) + # print ret ret['database'] = db_name ret3 = [] @@ -857,7 +857,7 @@ def getDbInfo(): data_size = table[0][6] ret2['rows_count'] = table[0][4] ret2['collation'] = table[0][14] - ret2['data_size'] = toSize(data_size) + ret2['data_size'] = public.toSize(data_size) ret2['table_name'] = i[0] ret3.append(ret2) except: