WLJS LogoWLJS Notebook

QuantityUnit

QuantityUnit[quantity] returns the unit associated with the specified quantity.

Examples

Extract the unit from a quantity:

QuantityUnit[Quantity[5, "Meters"]]
(* "Meters" *)

Get compound units:

QuantityUnit[Quantity[60, "Miles"/"Hours"]]
(* "Miles"/"Hours" *)

Extract from computed quantities:

QuantityUnit[Quantity[10, "Newtons"]*Quantity[2, "Meters"]]
(* "Joules" *)

Please visit the official Wolfram Language Reference for more details.

On this page