Skip to content

Commit

Permalink
add digits arg
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jun 28, 2023
1 parent 1ecd5ff commit f76c482
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions R/p_direction.R
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,6 @@ as.double.p_direction <- as.numeric.p_direction
#' @method format p_direction
#' @rdname p_direction
#' @export
format.p_direction <- function(x, as_percent = TRUE, ...) {
insight::format_value(as.numeric(x), as_percent = as_percent, ...)
format.p_direction <- function(x, digits = 2, as_percent = TRUE, ...) {
insight::format_value(as.numeric(x), digits = digits, as_percent = as_percent, ...)
}
9 changes: 8 additions & 1 deletion man/p_direction.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/test-p_direction.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ test_that("p_direction, formatting", {
expect_identical(out, "51.70%")

# out <- data.frame(p)
# out <- print(data.frame(p))
# print(data.frame(p))
})

0 comments on commit f76c482

Please sign in to comment.