How units are displayed

# Unitful.abbrFunction.

abbr(x) provides abbreviations for units or dimensions. Since a method should always be defined for each unit and dimension type, absence of a method for a specific unit or dimension type is likely an error. Consequently, we return ❓ for generic arguments to flag unexpected behavior.

source

# Unitful.prefixFunction.

prefix(x::Unit)

Returns a string representing the SI prefix for the power-of-ten held by this particular unit.

source

# Base.showMethod.

show(io::IO, x::Quantity)

Show a unitful quantity by calling show on the numeric value, appending a space, and then calling show on a units object U().

source

# Base.showMethod.

show(io::IO, x::Unitlike)

Call Unitful.showrep on each object in the tuple that is the type variable of a Unitful.Units or Unitful.Dimensions object.

source

# Unitful.showrepMethod.

showrep(io::IO, x::Unit)

Show the unit, prefixing with any decimal prefix and appending the exponent as formatted by Unitful.superscript.

source

# Unitful.showrepMethod.

showrep(io::IO, x::Dimension)

Show the dimension, appending any exponent as formatted by Unitful.superscript.

source

# Unitful.superscriptFunction.

superscript(i::Rational)

Prints exponents.

source