Method: Sass::Script::Value::Number#unit_str

Defined in:
lib/sass/script/value/number.rb

#unit_strString

Returns a human readable representation of the units in this number. For complex units this takes the form of: numerator_unit1 * numerator_unit2 / denominator_unit1 * denominator_unit2

Returns:

  • (String)

    a string that represents the units in this number



389
390
391
392
393
394
395
396
# File 'lib/sass/script/value/number.rb', line 389

def unit_str
  rv = @numerator_units.sort.join("*")
  if @denominator_units.any?
    rv << "/"
    rv << @denominator_units.sort.join("*")
  end
  rv
end