Skip to content

Currency normalization #478

@szewczykmira

Description

@szewczykmira

In my project I need to format currency so that it won't display digital decimals if they are equal to zero. Right now I'm doing it by replacing .00 to .## in current locale pattern and passing it as format to format_currency and setting currency_digits=False. It works like charm when price has 0 or 2 decimal digits, but I'm not sure how to handle prices with 3 decimal digits. Can I safely replace .00 with . + '#' * decimal_digits or it will cause problems I'm not aware of? Or maybe there is better solution for that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions