Permalink
Browse files

Fix for > int numbers

  • Loading branch information...
1 parent c19115b commit 9f4c46cf1420e66c9e2184d3d6984900e655e997 @dagwieers committed Nov 26, 2004
Showing with 7 additions and 3 deletions.
  1. +3 −0 ChangeLog
  2. +4 −3 dstat
View
@@ -1,3 +1,6 @@
+* 0.5.5
+- Abandoned the use of round() as it is limited to integers (Juergen Kreileder)
+
* 0.5.4
- Added a python 1.5 version of dstat (Ville Herva)
- Fixed a problem with count
View
7 dstat
@@ -884,17 +884,18 @@ def conv(max, var, base = 1024):
else:
color = ('darkred', 'darkyellow', 'darkgreen', 'darkblue', 'darkmagenta', 'darkcyan', 'silver', 'red', 'geen')
- if var < 0: return ' ' * (max-2) + '- '
+ if var < 0:
+ return ' ' * (max-2) + '- '
c = 0
while True:
- if len('%d' % round(long(var))) < max:
+ if len('%d' % long(var)) < max:
if not op.integer and len('%1.2f' % var) < max:
ret = '%1.2f' % var
elif not op.integer and len('%1.1f' % var) < max:
ret = '%1.1f' % var
else:
- ret = '%d' % round(long(var))
+ ret = '%d' % long(var)
break
var = var / base
c = c + 1

0 comments on commit 9f4c46c

Please sign in to comment.