How to display a Decimal Precision in UI?
  • 30 Jan 2023
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

How to display a Decimal Precision in UI?

  • Dark
    Light
  • PDF

Article Summary

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

decimal precision



Was this article helpful?

ESC

Eddy, a super-smart generative AI, opening up ways to have tailored queries and responses