How units are displayed

By default, exponents on units or dimensions are indicated using Unicode superscripts on macOS and without superscripts on other operating systems. You can set the environment variable UNITFUL_FANCY_EXPONENTS to either true or false to force using or not using the exponents.

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.

Unitful.prefixFunction
prefix(x::Unit)

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

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().

Unitful.showrepFunction
showrep(io::IO, x::Unit)

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

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

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