Method: Quantify::Unit::CompoundBaseUnitList#symbol

Defined in:
lib/quantify/unit/compound_base_unit_list.rb

#symbolObject

Derive a symbol for the unit based on the symbols of the base units

Get the units in order first so that the denominator values (those with negative powers) follow the numerators

Symbol format use unit symbols, with numerator symbols followed by denominator symbols and powers expressed using the “^” notation with ‘true’ values (i.e. preservation of minus signs).



170
171
172
173
174
175
176
# File 'lib/quantify/unit/compound_base_unit_list.rb', line 170

def symbol
  if Unit.use_symbol_denominator_syntax?
    attribute_string_with_denominator_syntax(:symbol,Unit.symbol_denominator_delimiter, Unit.symbol_unit_delimiter)
  else
    attribute_string_with_indices_only(:symbol,Unit.symbol_unit_delimiter)
  end
end