Skip to content

Update nf() page to indicate show righthand-only formatting #774

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

Closed
jeremydouglass opened this issue Sep 11, 2019 · 0 comments · Fixed by #775
Closed

Update nf() page to indicate show righthand-only formatting #774

jeremydouglass opened this issue Sep 11, 2019 · 0 comments · Fixed by #775

Comments

@jeremydouglass
Copy link
Contributor

jeremydouglass commented Sep 11, 2019

Issue description

Currently, nf() can be used for standard righthand-only formatting to limit decimal / floating point precision -- e.g.

println(nf(1.23456, 0, 3)); // prints 1.235

Despite this being one of the most common forms of number formatting, this usage is not shown on the nf reference page, confusing people who are looking for it. In fact, the reference suggests that 0 is not a valid value for the left argument, saying:

"The values for the digits, left, and right parameters should always be positive integers."

...which is not true.

As a result, over the years, the question of how to do this comes up over and over on the forums -- and people sometimes develop unneeded elaborate workarounds.

URL(s) of affected page(s)

https://processing.org/reference/nf_.html

Proposed fix

Update the page with an example and correct the argument text.

@jeremydouglass jeremydouglass changed the title Update nf() page to indicate show floating point formatting Update nf() page to indicate show righthand-only formatting Sep 11, 2019
jeremydouglass added a commit to jeremydouglass/processing-docs that referenced this issue Sep 11, 2019
@REAS REAS closed this as completed in #775 Nov 4, 2019
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.

1 participant