Skip to content

format functions fail on infinity #132

@Changaco

Description

@Changaco
>>> format_decimal(Decimal('Infinity'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "babel/numbers.py", line 165, in format_decimal
    return pattern.apply(number, locale)
  File "babel/numbers.py", line 563, in apply
    self.frac_prec[1]))
  File "babel/numbers.py", line 380, in bankersround
    a, b = split_number(value)
  File "babel/numbers.py", line 330, in split_number
    for i in range(-exp):
TypeError: bad operand type for unary -: 'str'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions