Flowdock
method

apply_seconds_precision

Importance_0
v5.2.3 - Show latest stable - 0 notes - Class: TimeValue
apply_seconds_precision(value) public

No documentation

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

Hide source
# File activemodel/lib/active_model/type/helpers/time_value.rb, line 24
        def apply_seconds_precision(value)
          return value unless precision && value.respond_to?(:usec)
          number_of_insignificant_digits = 6 - precision
          round_power = 10**number_of_insignificant_digits
          value.change(usec: value.usec - value.usec % round_power)
        end
Register or log in to add new notes.