Skip to content

format_compact_decimal incorrectly works when the pattern has no 0 characters #931

@jun66j5

Description

@jun66j5

Overview Description

format_compact_decimal incorrectly works when the pattern has no 0 characters. Also, it doesn't handle count="1" rule.

Steps to Reproduce

>>> from babel import numbers
>>> numbers.format_compact_decimal(1000, format_type='long', locale='it')
'mille1'  # should be 'mille'
>>> numbers.format_compact_decimal(1234, format_type='long', locale='it')
'mille1'  # should be '1 mila'
>>> numbers.format_compact_decimal(1000, format_type='long', locale='fr')
'1 millier'  # should be 'mille'
>>> numbers.format_compact_decimal(1234, format_type='long', locale='fr')
'1 millier'  # correct

Additional Information

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions