mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 20:40:14 +03:00
fix representation of FloatField
This commit is contained in:
parent
7c806aaaec
commit
3b1895effd
|
@ -878,7 +878,7 @@ class FloatField(Field):
|
||||||
self.fail('invalid')
|
self.fail('invalid')
|
||||||
|
|
||||||
def to_representation(self, value):
|
def to_representation(self, value):
|
||||||
return float(value)
|
return float(value) if value is not None else None
|
||||||
|
|
||||||
|
|
||||||
class DecimalField(Field):
|
class DecimalField(Field):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user