diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-10-09 00:59:19 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-10-09 00:59:19 +0000 |
commit | a49e7d5c0c5dc9f48d7c0b5a620d1528d998accc (patch) | |
tree | 6940639fad9dba18af32612b03c01590e6747410 /actionpack/test | |
parent | f9650a23f060c0d8678b2bda45e502f0bca487cc (diff) | |
download | rails-a49e7d5c0c5dc9f48d7c0b5a620d1528d998accc.tar.gz rails-a49e7d5c0c5dc9f48d7c0b5a620d1528d998accc.tar.bz2 rails-a49e7d5c0c5dc9f48d7c0b5a620d1528d998accc.zip |
Fixed that NumberHelper#number_to_delimiter should respect precision of higher than two digits (closes #6231) [phallstrom]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5249 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/number_helper_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/template/number_helper_test.rb b/actionpack/test/template/number_helper_test.rb index fd418d1e06..53e693382a 100644 --- a/actionpack/test/template/number_helper_test.rb +++ b/actionpack/test/template/number_helper_test.rb @@ -31,6 +31,15 @@ class NumberHelperTest < Test::Unit::TestCase def test_number_with_delimiter assert_equal("12,345,678", number_with_delimiter(12345678)) + assert_equal(nil, number_with_delimiter(nil)) + assert_equal("0", number_with_delimiter(0)) + assert_equal("123", number_with_delimiter(123)) + assert_equal("123,456", number_with_delimiter(123456)) + assert_equal("123,456.78", number_with_delimiter(123456.78)) + assert_equal("123,456.789", number_with_delimiter(123456.789)) + assert_equal("123,456.78901", number_with_delimiter(123456.78901)) + assert_equal("123,456,789.78901", number_with_delimiter(123456789.78901)) + assert_equal("0.78901", number_with_delimiter(0.78901)) end def test_number_to_human_size |