lib/lite/ruby/numeric.rb in lite-ruby-1.0.27 vs lib/lite/ruby/numeric.rb in lite-ruby-1.0.28
- old
+ new
@@ -171,12 +171,11 @@
precision = options[:precision] || 3
to_s.rjust(precision, pad_number.to_s)
end
- # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
- # rubocop:disable Metrics/MethodLength, Metrics/PerceivedComplexity
+ # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/PerceivedComplexity
def pad_precision(options = {})
pad_number = options[:pad_number] || 0
precision = options[:precision] || 2
separator = options[:separator] || '.'
string = to_s
@@ -189,11 +188,10 @@
string.ljust(ljust_count, pad_number.to_s)
else
string[0..(ljust_count - 1)]
end
end
- # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity
- # rubocop:enable Metrics/MethodLength, Metrics/PerceivedComplexity
+ # rubocop:enable Metrics/AbcSize, Metrics/MethodLength, Metrics/PerceivedComplexity
def percentage_of(number)
return 0 if zero? || number.zero?
(self / number.to_f) * 100.0