Number Formatting in Apps
  • 29 Aug 2024
  • 2 Minutes to read
  • Contributors

Number Formatting in Apps


Article summary

Learn how you can configure decimal precision for numbers shown in Interactive Table, Table Record and Variable widgets.

Availability

This feature is available in release r288 or later.

Legacy behavior

Widgets that were added to a step before r288 or created by coping such widgets will use the legacy formatting behavior.

For Interactive Table widgets all numbers will be shown with a maximum of three decimal places but without any trailing zeros.

For Variable widgets and Table Record widgets all numbers will be shown with the maximum number of decimal places configured in the now deprecated Decimal places setting of the widget which could be configured in the right side pane.

This legacy behavior can be changed by opening the formatting setting for any field and clicking the Update button in the formatting dialog. This will switch the widget from legacy behavior to the new behavior updating the formatting for all fields of the widget.

image.png

Overview

In Apps, number formatting lets you control the decimal precision for visualizing number-type data for Interactive Tables widgets, Table Record widgets and Variable widgets showing object variables. You can configure this for each number-type table field and object property in the Fields section of the widget configuration in the right side pane.

number-formatting-in-apps.gif

Note: This applies to Variable widgets showing object variables or lists of those (vs. other variables or just one specific field of an object variable), Table record widgets showing selected fields of records (vs. just one specific field of a record) and all configurations of Interactive Table widgets.

Default formatting

By default, Tulip is displaying each value with it's own number of decimal places. This number depends on the decimal places that were recorded when the value was stored into Tulip as well as the absolute size of the value.

Customization

You can customize the number of decimal places through the Number formatting dialog:

  • Clicking first on the left arrow button sets the display to 2 decimal places.
  • Clicking first on the right arrow button sets it to 3 decimal places.
  • Further clicks on the left or right arrows decrease or increase the decimal places displayed, respectively, between 0 and 15.

Numbers are rounded up if the next digit is 5 or higher, and down otherwise.

Number formatting can be reset to the default by clicking the Reset button.

Once configuration is complete, the Number formatting dialog can be closed with the Close button or by clicking anywhere outside of it.

Scope for number formatting

Number formatting is only applied to how numbers are shown in the widgets. The formatting does not affect how data is evaluated for filtering and sorting.


Was this article helpful?