aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2008-03-24 21:12:55 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-03-24 21:12:55 +0000
commit0e62c773f603f885743d52f44fb032290f809cae (patch)
tree542d823fc775423effed089d56d635f5d176704c /actionpack/test/template
parentc6f2af5c31577e25c6f6b9f17be18858200a8e13 (diff)
downloadrails-0e62c773f603f885743d52f44fb032290f809cae.tar.gz
rails-0e62c773f603f885743d52f44fb032290f809cae.tar.bz2
rails-0e62c773f603f885743d52f44fb032290f809cae.zip
Fixed NumberHelper#number_with_precision to properly round in a way that works equally on Mac, Windows, Linux (closes #11409, #8275, #10090, #8027) [zhangyuanyi]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9086 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template')
-rw-r--r--actionpack/test/template/number_helper_test.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/actionpack/test/template/number_helper_test.rb b/actionpack/test/template/number_helper_test.rb
index 00e5bd6461..7065ca7a84 100644
--- a/actionpack/test/template/number_helper_test.rb
+++ b/actionpack/test/template/number_helper_test.rb
@@ -56,9 +56,11 @@ class NumberHelperTest < Test::Unit::TestCase
def test_number_with_precision
assert_equal("111.235", number_with_precision(111.2346))
+ assert_equal("31.83", number_with_precision(31.825, 2))
assert_equal("111.23", number_with_precision(111.2346, 2))
assert_equal("111.00", number_with_precision(111, 2))
assert_equal("111.235", number_with_precision("111.2346"))
+ assert_equal("31.83", number_with_precision("31.825", 2))
assert_equal("112", number_with_precision(111.50, 0))
assert_equal("1234567892", number_with_precision(1234567891.50, 0))