Enable single stat widget to round decimals and set default truncation
Release notes
Problem to solve
Single stat widgets currently show decimal values to their full precision. This means that many numbers will be incredibly long, even though the extra digits are not significant.
For example, look at the dashboard below:
In this image, 40.2442748091603
takes up a large amount of space, when 40
or 40.2
would communicate the same amount of information in a much smaller space.
Users today have no way to customize this, so they must accept the full decimal value, even if it is not appropriate for their dashboard.
Proposal
Enable truncation and rounding of decimals in the single stat widget and set a default value for the amount of places rounded to.
- Introduce a new key/value pair for specifying the amount of decimal places to show.
- Use this for rounding to the nearest number, not truncation. So
40.677
would be shown as40.68
.
- Use this for rounding to the nearest number, not truncation. So
- If no rounding value is specified, default to zero decimal places for truncation (so whole numbers).
- The number above would be shown as
40
- The number above would be shown as
- This setting should be possible to set in the user facing YML file that they create, rather than needing an update directly with a Cube query.
- This value will be used as users build their dashboards inside their projects
.gitlab
directory, so making them go to Cube to change settings will be too much friction.
- This value will be used as users build their dashboards inside their projects
Open questions:
- Can we expose what Cube provides for measure formats?
Intended users
Feature Usage Metrics
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.