Value formatting refers to applying a special formatter to the value of a property, transforming the raw value to a more readable version. In the image below, the left-hand side (Before) shows the weight
and value
columns without any formatting. The right-hand side (After) has a unit (“kg”) applied to the weight
column and the value
column is displayed in a more compact form with a currency sign (“$100K”). These are both examples of numeric formatting. The Ontology also supports date and time formatting, as well as user ID formatting and resource RID formatting.
Type | Description |
---|---|
Numeric formatting | Add currencies/units/prefixes, various types of notations (compact, scientific), and percentages. See the numeric formatting section for more details. |
Date and time formatting | Render timestamps and dates in a specific format as well as in a specific timezone. |
Foundry ID formatting | Display a Foundry ID as a user's first and last name or group name. |
Resource RID formatting | Display a Foundry resource ID (RID) as an icon and resource name, with a clickable link that routes to that resource. |
In the property editor:
Name | Description | Usage |
---|---|---|
Numeric formatting | On/Off toggle. | Toggle this to remove/add numeric formatting. |
Base type | Contains various types of formatting available (Currency, Unit, Percentage, Prefix/Suffix, Fixed Values) as well as examples and descriptions of each type. | If Capacity in Pounds has an associated unit, select "Unit" from this dropdown. |
Use grouping | Adds locale-aware comma separator. | Toggle this on to go from 123456 to 123,456. |
Notation | Contains Compact/Scientific and Engineer notations. | Choose compact to approximate values, like 123K. |
Preview result | View and test numeric formatting. | Add any number in the input that is similar to what you'd expect to see in your property's values for a preview of the formatting. |
Name | Description | Example |
---|---|---|
Date | Only the date (no time) | Wed, Jul 22, 2020 |
Date and time (long) | Both the date and time, in long form | Wed, July 22, 2020, 1:00:00 PM |
Date and time (short) | Both the date and time, in short form | Jul 22, 2020, 1:00 PM |
ISO instant | Both the date and time (ISO 8601 format) | 2020-07-22T13:00:00.000Z |
Relative to now | The date relative to right now | 8 minutes ago |
Time | Only the time (no date) | 1:00 pm |
When formatting Relative to now, applications will only format in relative terms up to 24 hours ago. After this, it will render in Date and time (short) form with the day of the week: Wed, Jul 22, 2020, 1:00 PM
.
If you are formatting a timestamp, you can specify which timezone to render the timestamp, either as a static timezone that you input, or as the application user's current timezone. When entering a static timezone, you can search for a timezone by inputting the UTC offset or the locale name.
Value formatting can be applied to strings that are Foundry/Multipass user IDs or group IDs and convert them to display the user's first and last name or the group name by selecting the Multipass username option. This value formatting option is typically used when you have created an Action that edits a property and stores a user ID or group ID in one of the property fields. In the backing data, this information will be stored as the user's Foundry user ID or group ID, and the value formatting can be applied to render the user's name or the group instead of the ID.
Value formatting takes precedence over existing type classes in the UI. If you have both configured, value formatting will be displayed. You can however, use value formatting on one property and type classes on another.
Value formatting is supported for properties configured for inline edits. Properties with the legacy hubble:editable
type class will disable value formatting.