summaryrefslogtreecommitdiff
path: root/django/utils/numberformat.py
diff options
context:
space:
mode:
authorДилян Палаузов <Dilyan.Palauzov@db.com>2018-01-03 18:52:12 -0500
committerTim Graham <timograham@gmail.com>2018-01-03 20:12:23 -0500
commitd7b2aa24f75434c2ce50100cfef3586071e0747a (patch)
tree9074eb7522888e744f948c52174f367a4281c200 /django/utils/numberformat.py
parentc2d0f8c084456b5073252a91eeb09ab3d7453b18 (diff)
Fixed #28982 -- Simplified code with and/or.
Diffstat (limited to 'django/utils/numberformat.py')
-rw-r--r--django/utils/numberformat.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/django/utils/numberformat.py b/django/utils/numberformat.py
index e910be9206..c6f9af6893 100644
--- a/django/utils/numberformat.py
+++ b/django/utils/numberformat.py
@@ -42,8 +42,7 @@ def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='',
int_part, dec_part = str_number, ''
if decimal_pos is not None:
dec_part = dec_part + ('0' * (decimal_pos - len(dec_part)))
- if dec_part:
- dec_part = decimal_sep + dec_part
+ dec_part = dec_part and decimal_sep + dec_part
# grouping
if use_grouping:
try: