Formats p-value in line with APA standard, returning it without leading 0 and as < .001 (or below the smallest value expressible with the given number of significant digits) and > .99 when it is extremely small or large.
fmt_p(p_value, digits = 3, equal_sign = TRUE)
Respects the timesaveR.round_method
option for consistent rounding behavior
(see round_()
for details).
fmt_p(0.04355)
#> [1] "= .044"
fmt_p(0.0001)
#> [1] "< .001"
fmt_p(c(0.04355, 0.0001, 0.654), equal_sign = FALSE)
#> [1] ".044" "< .001" ".654"