* Support for context-aware methods during message extraction (#229, patch
from David Rios)
* "init" and "update" commands support "--no-wrap" option (#289)
+ * fix formatting of fraction in format_decimal() if the input value is a float
+ with more than 7 significant digits (#183)
Version 0.9.6
http://svn.edgewall.org/repos/babel/tags/0.9.6/
return '<%s %r>' % (type(self).__name__, self.pattern)
def apply(self, value, locale, currency=None):
+ if isinstance(value, float):
+ value = Decimal(str(value))
value *= self.scale
is_negative = int(value < 0)
if self.exp_prec: # Scientific notation
self.assertEqual(numbers.format_decimal(10.0**20,
'#.00', locale='en_US'),
'100000000000000000000.00')
+ # regression test for #183, fraction digits were not correctly cutted
+ # if the input was a float value and the value had more than 7
+ # significant digits
+ self.assertEqual(u'12,345,678.05',
+ numbers.format_decimal(12345678.051, '#,##0.00',
+ locale='en_US'))
def test_subpatterns(self):
self.assertEqual(numbers.format_decimal(-12345, '#,##0.##;-#',