Method: Quantify::Unit.use_superscript_characters=

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

.use_superscript_characters=(true_or_false) ⇒ Object

Declare whether superscript characters should be used for unit names, symbols and labels - i.e. “²” and “³” rather than “^2” and “^3”. Set to either true or false. If not set, superscript characters are used by default.



143
144
145
146
147
148
# File 'lib/quantify/unit/unit.rb', line 143

def self.use_superscript_characters=(true_or_false)
  raise Exceptions::InvalidArgumentError,
    "Argument must be true or false" unless true_or_false == true || true_or_false == false
  @use_superscript_characters = true_or_false
  refresh_all_unit_attributes!
end