67
while value > 1023.0 and n < len(self.UNITS) - 1:
67
# Use 1000 as the lower boundary for switching the the next-higher
68
# scale. 1024 would be more accurate, but may cause the returned number
69
# to consist of 5 numbers instead of 4.
70
# Thus, even though this change introduces a slight mathematical
71
# inaccuracy ('1.0 MiB/s' is returned instead of '1023.9 KiB/s'),
72
# it will save a few pixels here and there and is also more readable.
73
while value >= 1000.0 and n < len(self.UNITS) - 1:
68
74
value = value / 1024.0