Number Formatting in Analytics
  • 26 Jan 2025
  • 2 Minutes to read
  • Contributors

Number Formatting in Analytics


Article summary

Learn how you can configure decimal precision for numbers shown in Analyses

Availability

This feature is available with the Universal Template in release r279 or later. To use number formatting, consider migrating analyses using other templates to the Universal Template.

Overview

In the Analytics Editor, number formatting lets you control how many decimal places are displayed for numeric values without affecting the stored data or calculations. You can configure this for each numeric field by opening the Data panel on the right side and clicking the (123) button next to the field.

image.png

Number formatting is supported by all display types of the Universal Template, except the Slideshow.

Example

Below you can see an example how number formatting can be changed from the default to a customized state in a table visualization.

Example Number
0.1
0.12345
0.123456789
0.123456789123456789

Numer formatting example.gif

Default formatting

By default, Tulip displays each value with the decimal places it was recorded with, but this does not alter the stored value or its precision in calculations. 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 how many decimal places are shown in the Number Formatting dialog. This only changes the displayed value, not the actual stored number or how it is used in calculations:

  • 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.

If the same field from the query result is used multiple times in a visualization, e.g. for the y axis and the compare by in a bar chart, the formatting settings are shared among those uses.

Scope for number formatting

Number formatting is a display setting only. It does not change the precision of stored values, calculations, or visual elements like bar sizes. Number formatting is only applied to how numbers are shown in text form, e.g. in:

  • Tables
  • Single value and gauge visualizations
  • Tooltips
  • Axis labels
  • Legends

This does not affect how data is evaluated in calculations (e.g. for layers) or shown in visual representations (e.g. bar sizes), or the inherent decimal precision of the number.

To change the precision of numbers for visualization and calculations, use the ROUND function in an expression in the query on the left.


Was this article helpful?