Skip to content

Financial amounts: do not use Python floats #3998

@PascalRepond

Description

@PascalRepond

How it works

Fields that are used for financial information such as fees and acquisition accounts' amounts use Python floats. However, this is bad practice because Python doesn't manage floats very well and this can create problems with numbers that are poorly rounded (e.g. 145.000000089) and distorts some calculations.

Improvement suggestion

For acquisition amounts, store the data in the database as cents and add the floating point in the ui/api/serializers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Product Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions