Flowdock
method

round_significant

Importance_0
v6.0.0 - Show latest stable - 0 notes - Class: RoundingHelper
round_significant(number) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activesupport/lib/active_support/number_helper/rounding_helper.rb, line 35
        def round_significant(number)
          return 0 if number.zero?
          digits = digit_count(number)
          multiplier = 10**(digits - precision)
          (number / BigDecimal(multiplier.to_f.to_s)).round * multiplier
        end
Register or log in to add new notes.