aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorFrederick Cheung <frederick.cheung@gmail.com>2008-12-10 09:55:26 +0000
committerFrederick Cheung <frederick.cheung@gmail.com>2008-12-10 09:55:26 +0000
commit5745b25c9f71d86458f2d1cda65f800cbe4e6733 (patch)
tree0c6403d51c64519521566b4c31bb5149d6482f39 /activesupport
parent098cb8333c2f96612289c4511b0bcef67e97f771 (diff)
downloadrails-5745b25c9f71d86458f2d1cda65f800cbe4e6733.tar.gz
rails-5745b25c9f71d86458f2d1cda65f800cbe4e6733.tar.bz2
rails-5745b25c9f71d86458f2d1cda65f800cbe4e6733.zip
Fix example using wrong method name
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/float/rounding.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/core_ext/float/rounding.rb b/activesupport/lib/active_support/core_ext/float/rounding.rb
index 062d466838..fe89d11323 100644
--- a/activesupport/lib/active_support/core_ext/float/rounding.rb
+++ b/activesupport/lib/active_support/core_ext/float/rounding.rb
@@ -12,9 +12,9 @@ module ActiveSupport #:nodoc:
# Rounds the float with the specified precision.
#
# x = 1.337
- # x.round # => 1
- # x.round(1) # => 1.3
- # x.round(2) # => 1.34
+ # x.round_with_precision # => 1
+ # x.round_with_precision(1) # => 1.3
+ # x.round_with_precision(2) # => 1.34
def round_with_precision(precision = nil)
precision.nil? ? round_without_precision : (self * (10 ** precision)).round / (10 ** precision).to_f
end