Skip to content

Consistent blank before "%"#8366

Merged
bramkragten merged 4 commits intohome-assistant:devfrom
spacegaier:percentage-blank
Mar 7, 2021
Merged

Consistent blank before "%"#8366
bramkragten merged 4 commits intohome-assistant:devfrom
spacegaier:percentage-blank

Conversation

@spacegaier
Copy link
Copy Markdown
Member

Breaking change

Proposed change

Percent is basically a "unit", so we should consistently have a blank in front of it. In some areas we already do, in other not. With this PR it should now be (more) consistent.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@bramkragten
Copy link
Copy Markdown
Member

This is going to be another argument 😄

English style guides prescribe writing the percent sign following the number without any space between (e.g. 50%). However, the International System of Units and ISO 31-0 standard prescribe a space between the number and percent sign, in line with the general practice of using a non-breaking space between a numerical value and its corresponding unit of measurement.

@spacegaier
Copy link
Copy Markdown
Member Author

My opinion is that we should be consistent. Since we treat "%" as a unit in some places, we should do it everywhere (and that way be consistent with ISO rather that "just" one language even if it is EN). E.g. in the sensor card we have separation as we consider it the unit:
grafik

We do the same already for some/many entity rows:
grafik

Currently this leads to those inconsistencies:
grafik

grafik

@bramkragten
Copy link
Copy Markdown
Member

I'm ok with adding the space, was just mentioning that it could lead to another round of arguments :-)

@spacegaier
Copy link
Copy Markdown
Member Author

I'm ok with adding the space, was just mentioning that it could lead to another round of arguments :-)

I am fine with arguing for consistency, so point them to me :) .

I resolved the merge conflicts. Let me know if everything looks good.

@spacegaier spacegaier requested a review from bramkragten March 6, 2021 19:39
@bramkragten bramkragten merged commit c8ea37e into home-assistant:dev Mar 7, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Mar 8, 2021
@spacegaier spacegaier deleted the percentage-blank branch April 29, 2021 13:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants