mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Fixed #10513: floatformat now works with floatish things, not just real floats. Thanks, Alex.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10278 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
		| @@ -149,7 +149,9 @@ def floatformat(text, arg=-1): | ||||
|     except InvalidOperation: | ||||
|         if input_val in special_floats: | ||||
|             return input_val | ||||
|         else: | ||||
|         try: | ||||
|             d = Decimal(force_unicode(float(text))) | ||||
|         except (ValueError, InvalidOperation, TypeError, UnicodeEncodeError): | ||||
|             return u'' | ||||
|     try: | ||||
|         p = int(arg) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user