lib/comparison/presenter.rb
def percentage(**options)
      if nan? || zero?
        number_to_percentage 0, **options
      elsif infinite?
        # TODO: Return nil, or lookup an optional representation in I18n?
        nil
      elsif positive?
        number_to_percentage relative, format: '+%n%', **options
      else
        number_to_percentage relative, **options
      end
    end
def percentage(**options)
      if nan? || zero?
        number_to_percentage 0, **options
      elsif infinite?
        # TODO: Return nil, or lookup an optional representation in I18n?
        nil
      elsif positive?
        number_to_percentage relative, format: '+%n%', **options
      else
        number_to_percentage relative, **options
      end
    end
Returns Comparator#relative formatted as a percentage.

 If the relative percentage evaluates to Infinity or -Infinity, +nil+ is
 returned. If it evaluates to NaN, 0 is returned.