fmt_fix_digits | R Documentation |
Format a number with a fixed number of digits
fmt_fix_digits(xs, digits = 2)
xs |
a vector of numbers or a character vector representing numbers |
digits |
number of digits of precision |
# what we want to avoid
as.character(round(c(.4001, .1000, .5500), 2))
fmt_fix_digits(c(.4001, .1000, .5500), 1)
fmt_fix_digits(c(.4001, .1000, .5500), 2)
fmt_fix_digits(c(.4001, .1000, .5500), 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.