diff --git a/num2words/lang_PT_BR.py b/num2words/lang_PT_BR.py index 2c50f03..2aea06c 100644 --- a/num2words/lang_PT_BR.py +++ b/num2words/lang_PT_BR.py @@ -49,7 +49,7 @@ class Num2Word_PT_BR(lang_PT.Num2Word_PT): if nnum < 1000000: return next ctext = "um" - elif cnum == 100 and not nnum == 1000: + elif cnum == 100 and nnum % 1000 != 0: ctext = "cento" if nnum < cnum: diff --git a/tests/test_pt_BR.py b/tests/test_pt_BR.py index bbf9e8d..87e231b 100644 --- a/tests/test_pt_BR.py +++ b/tests/test_pt_BR.py @@ -80,6 +80,12 @@ class Num2WordsPTBRTest(TestCase): self.assertEqual( num2words(6000000, lang='pt_BR'), 'seis milhões' ) + self.assertEqual( + num2words(100000000, lang='pt_BR'), 'cem milhões' + ) + self.assertEqual( + num2words(100000000000, lang='pt_BR'), 'cem bilhões' + ) self.assertEqual( num2words(19000000000, lang='pt_BR'), 'dezenove bilhões' )