mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 12:30:11 +03:00
Add documentation for the coerce_to_string and localize FloatField parameters
This commit is contained in:
parent
fe0c4f9878
commit
a0c8d2f445
|
@ -250,10 +250,12 @@ A floating point representation.
|
|||
|
||||
Corresponds to `django.db.models.fields.FloatField`.
|
||||
|
||||
**Signature**: `FloatField(max_value=None, min_value=None)`
|
||||
**Signature**: `FloatField(coerce_to_string=None, max_value=None, min_value=None, localize=False)`
|
||||
|
||||
- `coerce_to_string` Set to `True` if string values should be returned for the representation, or `False` if `float` objects should be returned. Defaults to `False`. Note that setting `localize` will force the value to `True`.
|
||||
- `max_value` Validate that the number provided is no greater than this value.
|
||||
- `min_value` Validate that the number provided is no less than this value.
|
||||
- `localize` Set to `True` to enable localization of input and output based on the current locale. This will also force `coerce_to_string` to `True`. Defaults to `False`. Note that data formatting is enabled if you have set `USE_L10N=True` in your settings file.
|
||||
|
||||
## DecimalField
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user