Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix templatetag for no fractional bytes

In django 1.6, testing 0.0005 MB fails due to rounding issues.

Since a fractional byte makes no sense, just casting the float
value to an int.

Partially-implements: blueprint django-1point6
Change-Id: Id82faf32f0670f6342dac87a08affc10c7fda8de
  • Loading branch information...
commit b5bdd05966d25bc28d2a8b72fa54244d6cce6ece 1 parent cf252d2
@dklyle dklyle authored
Showing with 1 addition and 0 deletions.
  1. +1 −0  horizon/templatetags/sizeformat.py
View
1  horizon/templatetags/sizeformat.py
@@ -46,6 +46,7 @@ def filesizeformat(bytes, filesize_number_format):
"%(size)d Bytes", 0) % {'size': 0}
if bytes < 1024:
+ bytes = int(bytes)
return translation.ungettext_lazy("%(size)d Byte",
"%(size)d Bytes", bytes) % {'size': bytes}
if bytes < 1024 * 1024:
Please sign in to comment.
Something went wrong with that request. Please try again.