use decimal.Decimal instead of float to store amounts of money

This commit is contained in:
Romain Bignon 2012-03-29 16:14:32 +02:00
commit b157e92d5b
28 changed files with 111 additions and 69 deletions

View file

@ -18,6 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from decimal import Decimal
import re
import datetime
@ -53,9 +54,9 @@ class FrenchTransaction(Transaction):
debit = self.clean_amount(debit)
if len(debit) > 0:
self.amount = - float(debit)
self.amount = - Decimal(debit)
else:
self.amount = float(credit)
self.amount = Decimal(credit)
def parse(self, date, raw):
"""