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

The new precision feature does not work at all when Number Format for the user is set to None. Both UI and rounding is broken #15667

Closed
3 tasks done
KennethLavrsen opened this issue Mar 1, 2023 · 14 comments · Fixed by #15674

Comments

@KennethLavrsen
Copy link

KennethLavrsen commented Mar 1, 2023

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.

Describe the issue you are experiencing

The new precision feature is great - except it does not work.
But the UI has a small problem
If the value of a sensor happen to be a round number - the UI is not very user friendly in showing the choices in the pull down

See pictures below. Price is close to 2 and rounded off the first 2 decimals are zeros

And EDIT

The feature does not seem to work at all. Nothing happens no matter what value my sensors have

EDIT EDIT

The trigger is that the user has Number Format set to None which is a valid value and one I like to use. See discussion below.
As temporary work around people can set one of the other number formats

Describe the behavior you expected

The UI should show the zeros after the decimal

Like
2
2.0
2.00

and not
2
2
2

Steps to reproduce the issue

Have a sensor with a value that is with zeros like 2.000 or 1.99998
This will show
2
2
2
2
2
1.99998

Should be
2
2.0
2.00
2.000
2.0000
1.99998

Here is an actual example

image

I even had a sensor where the choices were
2
2
2
2
2
2

What version of Home Assistant Core has the issue?

core-2023.3.0

What was the last working version of Home Assistant Core?

new feature

In which browser are you experiencing the issue with?

Google Chrome

Which operating system are you using to run this browser?

Windows

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

@ildar170975
Copy link
Contributor

ildar170975 commented Mar 1, 2023

This is not quite clear for me:
"If the value of a sensor happen to be a round number - the UI is not very user friendly in showing the choices in the pull down"
because I always see same options:

image

image

image

@KennethLavrsen
Copy link
Author

It is worse

Even when you have a number with real random decimals the feature does nothing.

This is some sensors where I set the value to 2 decimals. And it ignores it and display the info like it was. It does not append 0. And it does not round off numbers. I cannot see that this feature works at all

image

@KennethLavrsen KennethLavrsen changed the title The UI for the new precision feature does not work well if the value happens to be round-ish at the moment The UI for the new precision feature does not work well if the value happens to be round-ish at the moment and rounding is broken Mar 1, 2023
@ildar170975
Copy link
Contributor

May be it is better to rename it to just "The UI for the new precision feature does not work well" ?

@ildar170975
Copy link
Contributor

And it ignores it and display the info like it was

Confirmed.
Here is a sensor from a standard system monitor integration:
image

image

After this:
image

we still get:
image

@piitaya
Copy link
Member

piitaya commented Mar 1, 2023

Do you have the issue in another browser (mobile)? I'm not able de reproduce it on my browser.

image

Display precision formatting is done client side so maybe your browser does format it right.

@KennethLavrsen
Copy link
Author

The feature does not work in Safari on my iPad either.

And also tried Firefox on Windows. Same problem with the feature now not working at all.

And I am talking about the actual feature not working. The numbers are not rounded no matter what I pick in the UI. In 3 different browsers

@ildar170975
Copy link
Contributor

Does not work in my iOS Companion App (iOS 15.x).
Frontend cache was reset.

Also checked in FF 110.0.1 (64-bit).

@KennethLavrsen
Copy link
Author

I tested on a Linux box. All my computers are with English OS and Danish keyboard. My decimal symbol is dot like in English. But I wonder if those that have it working have different locale on their computers. Paul is French. France, Germany and Denmark uses comma for decimal points. Can this influence something?

My locale is setup to be English UK. And with Danish keyboard because I need ÆØÅ to write to Danes

@ildar170975
Copy link
Contributor

ildar170975 commented Mar 1, 2023

@KennethLavrsen
You are genius!

If I use my current settings:
изображение

then I get this:
изображение

If I set this settings:
изображение

I get this:
изображение

I am absolutely sure that the "Precision feature" should work whatever local settings are chosen.

@KennethLavrsen
Copy link
Author

Last input before I go to bed. I checked the core entity register and the precision value gets stored correctly when I change it. It just does not do anything in the frontend

@KennethLavrsen
Copy link
Author

Yes. I just saw the posting before mine.

My number format (which I never noticed before) was set to none. If I set it to Auto - then the feature works.

So Paul. That should help. I wonder why the None value exist. But you probably need to deal with it somehow.

But it surely works now. That was a strange one

@KennethLavrsen
Copy link
Author

Just tried to set the number format to comma and it still works. It is only the None value that causes the issue.

@ildar170975
Copy link
Contributor

ildar170975 commented Mar 1, 2023

I wonder why the None value exist

It is a very useful option )))
Should not be excluded.
изображение

@KennethLavrsen
Copy link
Author

No I see now. It removes the 1000s feature which I prefer not being used. But now that Paul has the info he should also be able to reproduce it and fix it. And if he is sain - he is in bed now (same timezone as I). And now it is bedtime. Good teamwork

@KennethLavrsen KennethLavrsen changed the title The UI for the new precision feature does not work well if the value happens to be round-ish at the moment and rounding is broken The new precision feature does not work at all when Number Format for the user is set to None. Both UI and rounding is broken Mar 2, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants