I noticed that format_decimal implicitely asserts num_places > 0.
Using code like this
assert format_decimal(5.9, 0, "de")=="6"
generates the following exception:
======================================================================
ERROR: turbogears.i18n.tests.test_format.test_format_numbers
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/nose/case.py", line 202, in runTest
self.test(*self.arg)
File "/home/fs/3rdparty_svn/TurboGears/1.0/turbogears/i18n/tests/test_format.py", line 40, in test_format_numbers
assert format_decimal(5.9, 0, "de")=="6"
File "/home/fs/3rdparty_svn/TurboGears/1.0/turbogears/i18n/format.py", line 141, in format_decimal
num, decimals = str.split(".")
ValueError: need more than 1 value to unpack
I attached a patch which should work for 1.1 also - unfortunately I can't confirm this right now because I do not have all the necessary modules for 1.1 installed.