The price and decimal input components are improved to make them more intuitive and efficient to configure. This update ensures a more streamlined, user-friendly experience when handling price and decimal inputs. Here is what is changed.
Key issues addressed
- Formatting configuration – Formatting was handled via regex and was difficult to configure.
- Incorrect value saving – When saving a decimal like “9,999.00” to an action, everything before the comma was saved, and the rest was stripped by default.
New features
To resolve these issues, we've introduced these new configuration options:
- Decimal separator – Choose between a point (.) or a comma (,). Based on your decimal separator you are indirectly selecting the thousands separator.
- Scale number – Define the number of decimal places allowed.
- Thousands separator – Decide whether to display group separators for better readability.
With the introduction of these new options, the 'Validation pattern' and 'Pattern mismatch message' options became redundant and have been removed from the inputs.
Based on the option configurations on the inputs, strict input behavior is applied at runtime:
- End-users cannot manually insert thousands separators; the input handles this formatting automatically.
- Only one decimal separator can be used per input.
- Only numeric characters are allowed, no text characters.
Limitations
Every feature has its scope. Its a great principle to make to make this known:
- Max value: 10 trillion (10000000000000) by default. There is an option to set a lower maximum value if needed.
- Min value: -10 trillion (-10000000000000) by default. There is an option to set a higher minimum value if needed.
- Design vs. runtime formatting: The applied input formatting works only at runtime. Static default values in design time will not reflect it.
- Fixed decimal separator: The chosen decimal separator (. or ,) is compiled at runtime and cannot be changed dynamically per end-user.
- Static default values: The inputs only accept point (.) decimals without thousands (,) separators.
Impact
- Initial setup time: When adding the latest price and decimal component versions for the first time, expect a one-time setup delay of 30 to 60 seconds as dependencies are bundled into your application.
- Versioning: The update applies only to the latest version of the price and decimal components in the default component set. Existing components already in use will not be updated automatically.
Changed currency option
The currency option on price inputs has been updated to a different type to allow dynamic content instead of static text only. The currency option is used as an adornment on the price input field to prefix the currency (e.g. “$”) before or after the input’s value. This update allows you to fetch the currency from the database dynamically instead of static compiled text.
That was all for now, your feedback allows us to continuously improve our product. Please let us know what you think about it. Happy building! 😃