Rounds to significant digits, removing leading zeros.
Usage
round_probability(
p,
accuracy = 0.01,
digits = NULL,
max_digits = NULL,
remove_leading_zero = TRUE,
round_zero_one = TRUE,
phantom_text = NULL,
phantom_color = NULL
)Examples
round_probability(c(0, 0.0012, 0.012, 0.12, 0.99, 0.992, 0.9997, 1), digits = 2)
#> [1] "0" ".0012" ".012" ".12" ".99" ".992" ".9997" "1"
