← Back to team overview

openerp-expert-accounting team mailing list archive

Re: [Bug 865387] Re: wrong currency rounding

 

On Sun, Nov 6, 2011 at 12:42 PM, Lorenzo Battistini <
lorenzo.battistini@xxxxxxxxxxx> wrote:

> 2011/11/4 Olivier Dony (OpenERP) <865387@xxxxxxxxxxxxxxxxxx>:
> >
> > We don't use Decimal for OpenERP, our floating point calculations are
> all performed with floats, and we have appropriate solutions for all cases
> based on floats. So for consistency, please do not introduce the use of
> Decimal in patches.
> > For more info on the everlasting Float vs. Decimal discussion, see [1].
> >
> > [1] https://lists.launchpad.net/openerp-expert-accounting/msg00067.html
>
> Hello Olivier,
>
> I have one more doubt about floats: how could I manage this
>
> >>> round(2.675, 2)
> 2.67
>

The '2'  number is defined in currency.

Regards,

>
> ?
>
> I need 2.675 to become 2.68, and python suggests to use decimal for that:
> http://docs.python.org/tutorial/floatingpoint.html#tut-fp-issues
> (this is why I was using decimal in 'l10n_it' too)
>
> Thanks
>
>
> --
> Lorenzo Battistini
> Agile Business Group sagl              http://www.agilebg.com
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-expert-accounting
> Post to     : openerp-expert-accounting@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~openerp-expert-accounting
> More help   : https://help.launchpad.net/ListHelp
>



-- 
Cristian Salamea
@ovnicraft

Follow ups

References