Files
tryton/trytond/protocols/datatype.py
T
Cédric Krier 0415e46c73 Don't allow to use float in Numeric fields
The goal is to prevent to introduce float errors in Numeric fields.
There is a trick for external protocols like XML-RPC and JSON-RPC where the
string representation is stored in the Float object and will be used to
convert it into Decimal.
2010-03-12 17:41:07 +01:00

19 lines
437 B
Python

#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
class Float(float):
def __init__(self, value):
super(Float, self).__init__()
self.__decimal = value
@property
def decimal(self):
return self.__decimal
def __repr__(self):
return self.decimal
def __str__(self):
return self.decimal