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

Add space before units in toString() metod #665

Closed
ItamarKieslerFabric opened this issue Jun 3, 2024 · 1 comment · Fixed by #666
Closed

Add space before units in toString() metod #665

ItamarKieslerFabric opened this issue Jun 3, 2024 · 1 comment · Fixed by #666
Assignees
Labels
bug Something isn't working

Comments

@ItamarKieslerFabric
Copy link

Hi, thank you for maintaining this awesome package.

The official recommendation is to include a space between the quantity and the unit for all units except superscript units such as degrees. Can it please be added to toString() behaviour?

// Current version:
convert(5000, 'feet').to('best').toString(); // '1.524km'
// Desired behavior:
convert(5000, 'feet').to('best').toString(); // '1.524 km'
//                                        space here: ^

Thanks.

Sources:
https://www.nist.gov/pml/special-publication-811/nist-guide-si-chapter-7-rules-and-style-conventions-expressing-values#7.2
https://pml.nist.gov/cuu/Units/checklist.html (paragraph 15)
https://www.writing-skills.com/spaces-units-60-second-fix

@jonahsnider jonahsnider added the bug Something isn't working label Jun 4, 2024
@jonahsnider jonahsnider self-assigned this Jun 4, 2024
@jonahsnider
Copy link
Owner

Thank you for taking the time to link some resources about this! I'll take a look at those tomorrow and should be able to resolve this then as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants