Units
HasUnit
test whether a unit exists
Calling Sequence
Parameters
Description
Examples
HasUnit(unit, opts)
unit
-
symbol; unit name
opts
(optional) equation(s) of the form option=value where option is 'display'; specify options
The HasUnit(unit) function returns true if the name is accepted as a unit name. Otherwise, false is returned.
'display'=truefalse
If this option is true and the unit unit is accepted as a valid unit name, the default spelling with context is returned instead of true. Otherwise, false is returned.
with⁡Units:
Automatically loading the Units[Simple] subpackage
HasUnit⁡cm
true
HasUnit⁡mileUS_survey
HasUnit⁡Ω,display=true
ohmSI
HasUnit⁡ω
false
See Also
type/syntactically_valid_unit_name
Units/Commands
Units/Index
Units[AddUnit]
Units[GetUnit]
Units[GetUnits]
Download Help Document