Formats numbers with a prespecified number of digits after the decimal point.
num_digits(x, digits, format = "f", ...)
a numeric vector
an integer to indicate the number of digits to show.
format type passed to formatC()
.
additional parameters passed to formattable()
.
Other numeric vectors:
num_accounting()
,
num_comma()
,
num_currency()
,
num_percent()
,
num_scientific()
num_digits(pi, 2)
#> [1] 3.14
num_digits(123.45678, 3)
#> [1] 123.457