diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-02-02 02:59:10 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-02-02 02:59:10 +0000 |
commit | 9d79e0668d6a51573170ee568c5bac6717ec1a0c (patch) | |
tree | a0f80929db98c9751751d01e598d45f43a4cc1e6 /actionpack/lib | |
parent | b84a33ddd1f3c309a0bf13f487c7729eb6adccaa (diff) | |
download | rails-9d79e0668d6a51573170ee568c5bac6717ec1a0c.tar.gz rails-9d79e0668d6a51573170ee568c5bac6717ec1a0c.tar.bz2 rails-9d79e0668d6a51573170ee568c5bac6717ec1a0c.zip |
Fix number_to_human_size incorrectly removing trailing zeros. Closes #10099 [libc, developingchris]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8774 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/number_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/number_helper.rb b/actionpack/lib/action_view/helpers/number_helper.rb index eae230ad93..7dcba4a33e 100644 --- a/actionpack/lib/action_view/helpers/number_helper.rb +++ b/actionpack/lib/action_view/helpers/number_helper.rb @@ -170,7 +170,7 @@ module ActionView when size < 1.gigabyte; "%.#{precision}f MB" % (size / 1.0.megabyte) when size < 1.terabyte; "%.#{precision}f GB" % (size / 1.0.gigabyte) else "%.#{precision}f TB" % (size / 1.0.terabyte) - end.sub(/([0-9])\.?0+ /, '\1 ' ) + end.sub(/([0-9]\.\d*?)0+ /, '\1 ' ).sub(/\. /,' ') rescue nil end |