Skip to content

Commit

Permalink
Improve documentation on quantization of DecimalField
Browse files Browse the repository at this point in the history
* Specify how many decimal places are used by default to quantize value if left unset
* Clarify that decimal places should be intentionaly  set to `None` for not quantizing value
  • Loading branch information
gentooboontoo authored Apr 8, 2022
1 parent 57c6da1 commit 15f6896
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/wtforms/fields/numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ class DecimalField(LocaleAwareNumberField):
:param places:
How many decimal places to quantize the value to for display on form.
If None, does not quantize value.
If unset, use 2 decimal places.
If explicitely set to `None`, does not quantize value.
:param rounding:
How to round the value during quantize, for example
`decimal.ROUND_UP`. If unset, uses the rounding value from the
Expand Down

0 comments on commit 15f6896

Please sign in to comment.