Skip to content

ROUND_UP on flat_tax function #34

Description

@jdivins

Hello,
Could be possible add to the library an option to allow chose between round_up or round_down on the flat_tax function: https://github.com/mirumee/prices/blob/master/prices/tax.py#L30 ?
By this way:
gross = (base * fraction).quantize(Decimal('.01'), rounding=ROUND_UP)

And then allow choose this config in django-prices-vatlayes, here:
https://github.com/mirumee/django-prices-vatlayer/blob/master/django_prices_vatlayer/utils.py#L101 ?

I have tried with an amount of 171.50 * 1.21 of TAX
And the final result is = 207.515
With two decimals I expected that the final value has been: 207.52
But I get 207.51

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions