Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PanelEdit: Add description for auto decimals behaviour #53573

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions public/app/core/components/OptionsUI/registry.tsx
Expand Up @@ -280,6 +280,7 @@ export const getAllStandardFieldConfigs = () => {
id: 'decimals',
path: 'decimals',
name: 'Decimals',
description: 'Leave empty to calculate based on the value',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this? by default it's empty, and the default (empty) placeholder says "auto"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean this description does not really add any descriptive power other than saying it's automatic (and automatic I think implies it's based on the value) otherwise it would just be fixed

Copy link
Contributor Author

@joshhunt joshhunt Aug 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah fair. I agree, kinda. I wanted to see if there was something we could include to help clarify a part of the confusion from this https://github.com/grafana/support-escalations/issues/3553 - specifically mention that leaving blank will round decimal places,

When "Decimals" under standard options set to "auto", I expected it show 99.99 or for that matters any number of decimals like 99.999 or 99.99999

I dont think it’s clear what empty/auto means, and I think it’s reasonable to incorrectly assume that not specifying a value here will give you full precision.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If i could concisely describe what auto is (e.g. "Leave blank to round to 3 significant places"), I would, but im not 100% sure exactly what it is 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Leave blank to round automatically"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see also, #53331 (comment)

Copy link

@yosiasz yosiasz Aug 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto = grafana decides what happens to your number. Please git pull grafana and search code base to see what auto does

I kid, I kid! But I am trying to make the point that your basic grafana user has no clue what the heck happened to my trailing decimal numbers. 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@torkelo Is the documentation for this correct? https://grafana.com/docs/grafana/latest/panels/configure-standard-options/#decimals

Decimals

Number of decimals to render value with. Leave empty for Grafana to use the number of decimals provided by the data source.

"use the number of decimals provided by the data source" seems incorrect?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshhunt yes, that is incorrect

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshhunt , taking a shot here to see if we get any closer to desired wording. "Specify the number of decimals Grafana includes in the rendered value. If you leave this field blank, Grafana automatically truncates the number of decimals based on the value. For example...(add one or two examples of what Grafana does to a specific value)."

I can continue helping to tweak the wording based on the example.


editor: standardEditorsRegistry.get('number').editor as any,
override: standardEditorsRegistry.get('number').editor as any,
Expand Down