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

Space between numerical value and unit symbol for SI output #21

Closed
spellgen opened this issue May 21, 2015 · 5 comments · Fixed by moby/swarmkit#2903
Closed

Space between numerical value and unit symbol for SI output #21

spellgen opened this issue May 21, 2015 · 5 comments · Fixed by moby/swarmkit#2903

Comments

@spellgen
Copy link

Very nice collection here. Just a niggle - SI convention calls for a space between the number and the unit: 1 m, 10 kg, 123 mS ... etc

http://physics.nist.gov/Pubs/SP811/sec07.html

@kyrofa
Copy link

kyrofa commented Jun 3, 2015

Seconded-- should be the same for bytes.

@dmitshur
Copy link
Collaborator

dmitshur commented Jun 3, 2015

I think I'm in favor.

@dustin
Copy link
Owner

dustin commented Jun 3, 2015

It'd be fairly hard to make this configurable. I suppose it's the right thing to do, but it will take up seemingly unnecessary space in areas I use it where space is scarce and seemingly will just reduce clarity by taking logically grouped units and separating them into multiple parts.

e.g., instead of

1MB 1KB 1MB 1MB 1KB 1GB 1MB

I'd have

1 MB 1 KB 1 MB 1 MB 1 KB 1 GB 1 MB

@kyrofa
Copy link

kyrofa commented Jun 5, 2015

dustin, it only reduces clarity when you have it ambiguously spaced like in your example. These are the SI conventions. Right now I'm using regex to put the space in there!

@dustin dustin closed this as completed in 64dbdae Nov 9, 2015
@dmitshur
Copy link
Collaborator

dmitshur commented Nov 9, 2015

👍

dustin added a commit to dustin/humanFormat that referenced this issue May 13, 2016
dmitshur added a commit that referenced this issue Feb 28, 2017
When we added space between numbers and units in 64dbdae,
the README and package documentation weren't updated. This fixes that.

Also fix various other minor issues in documentation that I found.
Use single space between sentences in README, to follow Go style.

Follows 64dbdae.
Helps #21.
dustin pushed a commit that referenced this issue Feb 28, 2017
When we added space between numbers and units in 64dbdae,
the README and package documentation weren't updated. This fixes that.

Also fix various other minor issues in documentation that I found.
Use single space between sentences in README, to follow Go style.

Follows 64dbdae.
Helps #21.
thaJeztah added a commit to thaJeztah/swarmkit that referenced this issue Sep 25, 2019
full diff: dustin/go-humanize@8929fe9...v1.0.0

probably most relevant change:

- dustin/go-humanize@64dbdae Add space between the numbers and units
  - closes dustin/go-humanize#21 Space between numerical value and unit symbol for SI output
  - related: dustin/go-humanize#32 no space between bytes and units

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
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 a pull request may close this issue.

4 participants