-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Closed
Labels
Milestone
Description
I have a model containing FloatField field:
coste = models.FloatField(null=True, blank=True)
and I have built a browsable API for the model using djangorestframework.
In the put form of the browsable API, the coste
field is automatically formatted using a comma separator (so 3.0
is shown in the form as 3,0
). I guess django or djangorestframework are formatting it according to my system locale.
However, if the form is submitted an error because of the number formatting:
HTTP 400 Bad Request
{
"coste": [
"Se requiere un número válido. [means: A valid number is required]"
]
}
I am aware that djangorestframework does not support localized decimal fields (according to #2897), but I would expect that it is able to create a non-localized field which correctly works on a localized environment.