-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from Bosma/osmaxpos
osMaxPos rounding to digit parameter, pull request #42
- Loading branch information
Showing
2 changed files
with
5 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
559d512
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The argument to round() is for the number of digits after the decimal place to keep, not the number of digits to round to.
round(400.04, 0) = 400
numeric number of digits (0) to round positions size 400.04 results in ''
round(400.04, 3) = 400.04
numeric number of digits (3) to round positions size 400.04 results in 400
Is that description what you intended as the behavior?
559d512
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I updated the docs this PR/merge touched, I did not attempt to alter the intent of the parameter documentation. That is to say, this is still a potential issue.
559d512
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do agree that the documentation could be improved. It should probably be drawn from and refer to round, e.g.:
#' @param digits integer indicating the number of decimal places to be used. Negative values are allowed. See \code{\link[base]{round}}