Index: django/template/defaulttags.py
===================================================================
--- django/template/defaulttags.py	(revision 10834)
+++ django/template/defaulttags.py	(working copy)
@@ -409,7 +409,9 @@
             value = float(value)
             maxvalue = float(maxvalue)
             ratio = (value / maxvalue) * max_width
-        except (ValueError, ZeroDivisionError):
+        except ZeroDivisionError:
+            return str(0)
+        except ValueError:
             return ''
         return str(int(round(ratio)))
 
Index: tests/regressiontests/templates/tests.py
===================================================================
--- tests/regressiontests/templates/tests.py	(revision 10834)
+++ tests/regressiontests/templates/tests.py	(working copy)
@@ -931,7 +931,7 @@
 
             ### WIDTHRATIO TAG ########################################################
             'widthratio01': ('{% widthratio a b 0 %}', {'a':50,'b':100}, '0'),
-            'widthratio02': ('{% widthratio a b 100 %}', {'a':0,'b':0}, ''),
+            'widthratio02': ('{% widthratio a b 100 %}', {'a':0,'b':0}, '0'),
             'widthratio03': ('{% widthratio a b 100 %}', {'a':0,'b':100}, '0'),
             'widthratio04': ('{% widthratio a b 100 %}', {'a':50,'b':100}, '50'),
             'widthratio05': ('{% widthratio a b 100 %}', {'a':100,'b':100}, '100'),
