How to display a Decimal Precision in UI?
- 30 Jan 2023
- 1 Minute to read
- Contributors
- Print
- DarkLight
- PDF
How to display a Decimal Precision in UI?
- Updated on 30 Jan 2023
- 1 Minute to read
- Contributors
- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
In the EdgeReady Platform, the decimal datatype is available for data such as cost, length, volume, latitude, longitude, etc. When displaying such data in the UI, if the precisions include trailing zeros, they are not displayed in the UI.
For example, if the cost of an item is calculated as 100.9, the UI should display the value as 100.90 . To display the trailing zeroes in a decimal number, use a custom function to set precision. Refer the following snippet for implementation:
A function setPrecision2 is defined with input parameter as the cost variable.
- Input : 100.9
- Output : 100.90
Was this article helpful?