Unit Definitions for FSM Mobile Number Elements
In Field Service Management (FSM) Mobile, unit is a key that identifies a named formatting profile. It is not a separate element type and doesn't convert the stored number. FSM Mobile looks up the configured key in the mobile configuration's "units" collection. When a definition is available, FSM Mobile uses its formatting members to render the Number element.
A unit definition does not set the Number element's min, max, step, stepper, or value properties. If the definition includes precision, that precision takes precedence over the element's precision and any precision inferred from step. The resulting precision is used for the editable Number control and for display.
The default mobile route provides definitions such as:
{
"usd": { "prefix": "$", "precision": 2 },
"percent": { "suffix": "%" },
"byte": { "suffix": "B", "precision": 0, "multiple": 1024 },
"celsius": { "suffix": "°C" }
}
You can add an account-specific unit by adding another key to the mobile configuration's "units" collection, then setting the Number element's "unit" property to that key. For example:
{
"jpy": { "prefix": "¥", "precision": 0 },
"kilogram": { "suffix": " kg", "precision": 2 }
}
With these definitions, "unit": "jpy" displays a whole-number amount with a yen prefix, and "unit": "kilogram" displays a value such as 2.50 kg. The stored values remain numbers; the unit does not convert yen, kilograms, or any other value to a different base value.
Unit-definition members are renderer settings rather than Number-element properties. The mobile Number renderer reads these members directly. Use the following configuration guidance:
|
Unit member |
Configuration guidance |
Effect |
|---|---|---|
|
|
String |
Added before the displayed number. |
|
|
String |
Added after the displayed number. |
|
|
Use a whole number from |
Overrides the element's |
|
|
Use a positive numeric factor greater than |
Enables read-only magnitude scaling. The renderer repeatedly divides the displayed value by this value and adds K, M, or G before the suffix. It does not change the stored value or editable entry. |
The Celsius suffix is the two-character text °C: Unicode degree sign ° (U+00B0), followed by uppercase C. Use that literal text in JSON. Do not use the HTML entity °C, because unit suffixes are rendered as text rather than decoded as HTML.
Do not document a unit identifier such as usd or percent as universally available unless the relevant account or release provides that unit definition. The source supports custom unit keys, so the available keys are configuration-dependent.