Sha256: 6e3e3e6182705a3a0296c19cea2c7d2a1e21e7a119e3207fb7c0b6d0f5e56963

Contents?: true

Size: 317 Bytes

Versions: 7

Compression:

Stored size: 317 Bytes

Contents

##
# This class includes extensions for the Float datatype.

class Float

  ##
  # Since CVSS 3 all float values are rounded up, therefore this method is used instead of the mathematically correct method round().

  def round_up(decimal_paces = 0)
    (self * 10.0**decimal_paces).ceil / 10.0**decimal_paces
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cvss-suite-1.0.6 lib/cvss_suite/helpers/extensions.rb
cvss-suite-1.0.5 lib/cvss_suite/helpers/extensions.rb
cvss-suite-1.0.4 lib/cvss_suite/helpers/extensions.rb
cvss-suite-1.0.3 lib/cvss_suite/helpers/extensions.rb
cvss-suite-1.0.2 lib/cvss_suite/helpers/extensions.rb
cvss-suite-1.0.1 lib/cvss_suite/helpers/extensions.rb
cvss-suite-1.0.0 lib/cvss_suite/helpers/extensions.rb