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

Format specification docs for signs and zero values is unclear #2493

Closed
seanmiddleditch opened this issue Sep 9, 2021 · 1 comment
Closed

Comments

@seanmiddleditch
Copy link

The format specification mini-language documentation on the website states:

Option Meaning
'+' indicates that a sign should be used for both positive as well as negative numbers.
'-' indicates that a sign should be used only for negative numbers (this is the default behavior).
space indicates that a leading space should be used on positive numbers, and a minus sign on negative numbers.

The use of "positive" here should perhaps instead say "nonnegative" since they affect zero values.

e.g., format("{+}", 0) produces "+0", but the documentation as written could be interpreted as expecting the result to be "0" with no sign.

vitaut added a commit that referenced this issue Sep 10, 2021
@vitaut
Copy link
Contributor

vitaut commented Sep 10, 2021

Fixed in https://fmt.dev/dev/syntax.html, thanks.

@vitaut vitaut closed this as completed Sep 10, 2021
PoetaKodu pushed a commit to pacc-repo/fmt that referenced this issue Nov 11, 2021
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

No branches or pull requests

2 participants