diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2007-01-03 05:29:34 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2007-01-03 05:29:34 +0000 |
| commit | c3f891210a05a9593e3df4cb04dfda7442af2065 (patch) | |
| tree | 82b7f71f2b66189ef7141387faa8aeed75101cbc /tests/regressiontests | |
| parent | 9e0c5d1ecdd5b57b8e044230b09d7903835e6116 (diff) | |
Fixes #3176, #3004 -- Added an argument to the floatfilter to allow users to specify precision of floats, Thanks, Eric Floehr.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4274 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests')
| -rw-r--r-- | tests/regressiontests/defaultfilters/tests.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/regressiontests/defaultfilters/tests.py b/tests/regressiontests/defaultfilters/tests.py index 32d6ef5202..439a40c31b 100644 --- a/tests/regressiontests/defaultfilters/tests.py +++ b/tests/regressiontests/defaultfilters/tests.py @@ -11,6 +11,26 @@ r""" '0.0' >>> floatformat(0.0) '0' +>>> floatformat(7.7,3) +'7.700' +>>> floatformat(6.000000,3) +'6.000' +>>> floatformat(13.1031,-3) +'13.103' +>>> floatformat(11.1197, -2) +'11.12' +>>> floatformat(11.0000, -2) +'11' +>>> floatformat(11.000001, -2) +'11.00' +>>> floatformat(8.2798, 3) +'8.280' +>>> floatformat('foo') +'' +>>> floatformat(13.1031, 'bar') +'13.1031' +>>> floatformat('foo', 'bar') +'' >>> addslashes('"double quotes" and \'single quotes\'') '\\"double quotes\\" and \\\'single quotes\\\'' |
