Review: Needs Fixing

I just realized that the form

round(amount / currency.rounding) * currency.rounding

is also used to allow a generic 'currency.rounding'.

For instance, I could want to allow the following amounts:
0.00 - 0.05 - 0.10 - 0.15 ...
avoiding 0.01 - 0.02 - 0.03 ...
so I would have to set currency.rounding = 0.05

Because of that, maybe we can use something like this:

float(Decimal(str(round(amount / currency.rounding) * 
currency.rounding)).quantize(Decimal(str(currency.rounding)), 
rounding=ROUND_HALF_UP))
-- 
https://code.launchpad.net/~openerp-dev/openobject-server/6.0-opw-18123-Lorenzo_Battistini/+merge/79087
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-server/6.0-opw-18123-Lorenzo_Battistini.

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to