Purpose
Returns a string representing the abbreviated version of a standard MapInfo Pro unit name. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
UnitAbbr$( unit_name )
unit_name is a string representing a standard MapInfo Pro unit name (for example, "km").
Return Value
String expression, representing an abbreviated unit name (for example, "km")
Description
The unit_name parameter must be one of MapInfo Pro's standard, English-language unit names, such as "km" (for kilometers) or "sq km" (for square kilometers).
The UnitAbbr$() function returns an abbreviated version of the unit name. The exact string returned depends on whether the user is running the English-language version of MapInfo Pro or a translated version. For example, if a user is running the German-language version of MapInfo Pro, the following function call returns the German translation of "sq km":
UnitAbbr$("sq km")
The UnitAbbr$() function can operate on units of distance, area, paper, and time. For a listing of MapInfo Pro's standard distance unit names (for example, "km"), see Set Distance Units statement. For a listing of area unit names (for example, "sq km"), see Set Area Units statement. For a listing of paper unit names (for example, "in" for inches on a page layout), see Set Paper Units statement. Time unit names include seconds ("sec"), minutes ("min"), and hours ("hr").
The unit_name parameter can also be "degree" (in which case, UnitAbbr$() returns "deg").
See Also:
Set Area Units statement, Set Distance Units statement, Set Paper Units statement, UnitName$() function