Save py2.6 from Decimal Float fun
This commit is contained in:
parent
5e94637adc
commit
13d8dfdb5f
@ -297,8 +297,9 @@ class DecimalField(BaseField):
|
||||
if value is None:
|
||||
return value
|
||||
|
||||
return decimal.Decimal(value).quantize(self.precision,
|
||||
rounding=self.rounding)
|
||||
# Convert to string for python 2.6 before casting to Decimal
|
||||
value = decimal.Decimal("%s" % value)
|
||||
return value.quantize(self.precision, rounding=self.rounding)
|
||||
|
||||
def to_mongo(self, value):
|
||||
if value is None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user