Module talk:Sandbox/Johnuniq/unit
The following demonstrates use of the _unit
function exported from Module:Convert/sandbox.
Each ">" line shows the function call (renamed as unit) with parameters:
- unitcode
- options table (value for sort key; flags for linking, showing name instead of symbol, using US spelling of name)
The result line shows:
- the unit symbol or name, optionally linked
- "(unknown)" if convert did not recognize the unitcode
- sort key based on value from converting input to a base unit (so 99 feet will sort before 1 kilometer)
{{#invoke:sandbox/Johnuniq/unit|main}}