diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2017-12-30 18:05:15 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-12-30 18:05:15 +0100 |
| commit | 51a00749e9d1814acfb6bf8732ecd21f18944083 (patch) | |
| tree | c03edebd5a5263fc1ff622d6fa526a7918f437c9 /django/forms | |
| parent | 9bc4d90d1a8c4d1dee54115a0995a7b6fca8635b (diff) | |
Used Decimal.scaleb() in backends.utils.format_number() and DecimalField.widget_attrs() to improve performance.
Diffstat (limited to 'django/forms')
| -rw-r--r-- | django/forms/fields.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/forms/fields.py b/django/forms/fields.py index 92a8f768c4..61f5ccfe58 100644 --- a/django/forms/fields.py +++ b/django/forms/fields.py @@ -360,7 +360,7 @@ class DecimalField(IntegerField): if self.decimal_places is not None: # Use exponential notation for small values since they might # be parsed as 0 otherwise. ref #20765 - step = str(Decimal('1') / 10 ** self.decimal_places).lower() + step = str(Decimal(1).scaleb(-self.decimal_places)).lower() else: step = 'any' attrs.setdefault('step', step) |
