436 fr function format sigfig j - #437
Conversation
There was a problem hiding this comment.
Overall, the idea looks good to me. Nevertheless, it would be good to clarify and potentially improve some of the design assumptions and implementation details, as indicated in my comments.
Please also check whether the CI/CD failure is related to the new code.
|
|
||
| #' @return numeric vector of the same length as `x`, rounded to `digits` significant figures. | ||
| #' @keywords internal | ||
| signif_j <- function(x, digits = 6, round_type = valid_round_type, whole_integer = FALSE, zero_threshold = 0) { |
There was a problem hiding this comment.
I'd aim for the most straightforward extension of base::signif(): preserve its behavior while allowing custom rounding, including the support for round_fun that does not support negative digits; and an optional zero_threshold.
I propose:
signif_j <- function(
x,
digits = 6,
zero_threshold = 0,
round_fun = round_fmt,
...
)Here, ... are passed as arguments to round_fun.
CI/CD issues are not related to us, just ubuntu stuff, will resolveshortly |
Pull Request
Fixes #436
Checks