class Filesize

def to_s(unit = 'B', args = {})

Other tags:
    See: #to_f -

Returns:
  • (String) - Same as {#to_f}, but as a string, with the unit appended.

Parameters:
  • () --
def to_s(unit = 'B', args = {})
  precision = args[:precision] || PRECISION
  
  "%.#{precision}f %s" % [to(unit).to_f.to_s, unit]
end