-
Notifications
You must be signed in to change notification settings - Fork 227
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
Does not follow user profile configured "Number Format" #1010
Comments
Same as closed #774 |
Regardless the state of this issue, the user interface does not look good with this. |
Up up up |
Would be really nice to get this fixed, it looks a bit strange with different number formats on the dash. |
This should be treated as a bug, not an enhancement. |
Up |
No need to "up" here. It only makes sense to prevent "stale". |
Can you please label this as "bug"? This is not an enhc. |
I also agree this is not an enhancement but a bug. |
I can set here "bug", but it may not "speed up" implementation... |
I found my solution. For those want to use "." as thousand seperator and "," for decimals. I am not a developer so I couldnt do it more generic way but It works anyway
change it with the code below. I prefered Turkish. So now my numbers are now formatted like 1.233.444,89 and I am still using HA in English.
|
Maybe My last suggestion speed it up ;) |
Not really, cat. The addon should be following the Home Assistant defined settings on the Number Format specifically and not just use the default number format of the language chosen for the HA UI. And also not one random language format. For example, I have HA UI language set to "English", but the Number format to "None" because I can not stand having extra thousand separator symbols. It works (almost) everywhere in HA, but this addon just ignores the very explicit Number format setting and instead tries to guess the number format from the UI language, which is a bug. |
Sure, but I at least some of us get what they need. Agree for the rest |
I wonder if home-assistant/frontend#17249 can be used to get HA to format the values correctly. |
May be I am missing something, see no need to connect “number format” and “language”, imho these are independent settings. |
Yes, they are. Currently the code in mini-graph-card just uses "language" setting and then asks an external library to format numbers (and dates) in accordance to the rules of that language. And completely ignores the HA settings for number format and date format. |
And in HA itself there are some “connections” between a language and a number format - which makes a code more complex and buggy. |
What happens if you start playing with a language, will it affect mini-graph? |
Yes, switching from "English" to German, for example, would change the decimal separator from "." to "," and the thousand separator from "," to ".". And switching language to Esperanto would change the thousand separator to " " and decimal separator to ",". The code in https://github.com/kalkih/mini-graph-card/blob/master/src/main.js#L720 literally just gives the value to the browser function Intl.NumberFormat along with the currently configured system language. |
https://developers.home-assistant.io/docs/frontend/data/#hassformatentityattributevaluestateobj-attribute-value describes the function that is there to format the value correctly, according to settings of both HA and of the entity itself (like you can set precision on the entity). It is available to mini-graph-card. |
@ildar170975 @kalkih Any development to current issue ? No updates from Feb 20, is this still considered for implementation ? |
the number format, as defined in the profile settings, is not honored.
The text was updated successfully, but these errors were encountered: