What are Custom Number Formats?
Authors can now choose for numbers to have a custom format for number inputs, number values and calculation nodes.
Why would you use Custom Number Formats?
There are some cases where authors may want to choose a number format other than the default:
- A number that should not be displayed with a separator, such as a document ID.
- A number that may need to display a format other than the region's default.
How can you use Custom Number Formats?
Number inputs, calculation nodes and number values all have an additional toggle 'Custom number format' with the following options:
- Region default: will always match the region of the published module. If this is changed, the number format will change with it.
- Comma: Use a comma (,) for a thousand separator [and a period (.) for decimals]. This will remain static even if the module region changes.
- Period: Use a comma (,) for a thousand separator [and a period (.) for decimals]. This will remain static even if the module region changes.
- None: Do not display a thousands separator
If none is selected, additional options follow the the same rules above as for the decimal separator.
- Region Default
Use case examples and best practices
👍 Good use of custom number formats
- disable any thousand separators in document IDs
- disable formatting for numbers used as loop IDs or any number that will be iterated
- to enable multi-lingual or cross-regional paths in your module that require different number formats
👎 Bad use of custom number formats
- not all numerical values that you would consider numbers are actually numbers, post codes are an example of digits that are actually better used as text or string values - consider using a text value or text input and apply Regular expressions
- user number inputs or number values for numbers with leading zeros (0053), non-number characters or spaces (A34, 22-4444, 0151 555555), or to restrict the number of decimal places to show (for example currencies or monetary values such as 35.99) - these are not supported