summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/formats.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/utils/formats.py b/django/utils/formats.py
index d5e5a555f6..028e11415a 100644
--- a/django/utils/formats.py
+++ b/django/utils/formats.py
@@ -197,6 +197,8 @@ def localize(value, use_l10n=None):
elif isinstance(value, bool): # Make sure booleans don't get treated as numbers
return str(value)
elif isinstance(value, (decimal.Decimal, float, int)):
+ if use_l10n is False:
+ return str(value)
return number_format(value, use_l10n=use_l10n)
elif isinstance(value, datetime.datetime):
return date_format(value, 'DATETIME_FORMAT', use_l10n=use_l10n)