Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #687 -- Fixed bug in floatformat template filter and added unit…
… tests. Thanks, Sune git-svn-id: http://code.djangoproject.com/svn/django/trunk@1007 bcc190cf-cafb-0310-a4f2-bffc1f526a37
- Loading branch information
1 parent
d4abd6f
commit e0d2793
Showing
2 changed files
with
27 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
>>> floatformat(7.7, None) | ||
'7.7' | ||
>>> floatformat(7.0, None) | ||
'7' | ||
>>> floatformat(0.7, None) | ||
'0.7' | ||
>>> floatformat(0.07, None) | ||
'0.1' | ||
>>> floatformat(0.007, None) | ||
'0.0' | ||
>>> floatformat(0.0, None) | ||
'0' | ||
""" | ||
|
||
from django.core.template.defaultfilters import * | ||
|
||
if __name__ == '__main__': | ||
import doctest | ||
doctest.testmod() |