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

FIX: Moved percent sign to right #183

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jamesshannon
Copy link

Hi. Thanks for all the work on this.

With that being said, the formatting of the percent sign was driving me crazy. :) In the US, at least, the percent sign goes after the number. I see you're from AU, and I thought it was the same?

Assuming that there are some locales where % comes before the number, that formatting should be handled by HA, but I couldn't find any useful l10n code.

* Moved percent sign to right of number, per standard english formating.
* Modified parser to additionally detect percent sign as last character
@rgc99
Copy link
Owner

rgc99 commented Sep 5, 2024

You are correct, this is one thing most of the world can agree on. There appears to be some exceptions but I don't believe these are catered for in HA or most OS's for that matter. I share your pain every time I look at the m/d format on my fitbit.

The format on the adjustment attribute wasn't meant to be human readable. Just like dates which need to be localised the adjustment should also be formatted. The idea is the first character is the operator one of +-=% and then follows the value. This makes it simple with jinja code to do the crazy things people expect.

It would be best if the humanisation was done on the frontend along with language, date/time, numbers etc. At the moment the adjustment on the card just reflects the entity attribute, probably a little lazy. I can add some formatting to the card to ease the suffering. Doing this on the backend as you propose will break many tests that are in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants