# File lib/rspec/core/formatters/helpers.rb, line 9 def format_seconds(float) precision ||= (float < 1) ? SUB_SECOND_PRECISION : DEFAULT_PRECISION formatted = sprintf("%.#{precision}f", float) strip_trailing_zeroes(formatted) end
# File lib/rspec/core/formatters/helpers.rb, line 15 def strip_trailing_zeroes(string) stripped = string.sub(/[^1-9]+$/, '') stripped.empty? ? "0" : stripped end
[Validate]
Generated with the Darkfish Rdoc Generator 2.