Sha256: 62288dc3ba00e68b66e1181aeb5dc0a380bc85b5645134284fc1ea70f1c06681
Contents?: true
Size: 424 Bytes
Versions: 9
Compression:
Stored size: 424 Bytes
Contents
module Maths class Formatter # Public: Formats values for us to output. def self.format(val) if val.nil? output = "Undefined" elsif !val.is_a?(Numeric) output = val.to_s elsif val.frac == 0 output = val.to_i.to_s else output = val.to_s("F") end if val.is_a?(Percentage) output += "%" end output end end end
Version data entries
9 entries across 9 versions & 1 rubygems