Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix example using wrong method name

  • Loading branch information...
commit 5745b25c9f71d86458f2d1cda65f800cbe4e6733 1 parent 098cb83
@fcheung fcheung authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 activesupport/lib/active_support/core_ext/float/rounding.rb
View
6 activesupport/lib/active_support/core_ext/float/rounding.rb
@@ -12,9 +12,9 @@ def self.included(base) #: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
Please sign in to comment.
Something went wrong with that request. Please try again.