How units are displayed
#
Unitful.abbr
— Function.
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.
#
Unitful.prefix
— Function.
prefix(x::Unit)
Returns a string representing the SI prefix for the power-of-ten held by this particular unit.
#
Base.show
— Method.
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()
.
#
Base.show
— Method.
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.
#
Unitful.showrep
— Method.
showrep(io::IO, x::Unit)
Show the unit, prefixing with any decimal prefix and appending the exponent as formatted by Unitful.superscript
.
#
Unitful.showrep
— Method.
showrep(io::IO, x::Dimension)
Show the dimension, appending any exponent as formatted by Unitful.superscript
.
#
Unitful.superscript
— Function.
superscript(i::Rational)
Prints exponents.