str_round | R Documentation |
Round a number to desired number of shown digits
str_round(x, digits = 2, less_than = NULL, more_than = NULL, pad = F)
x |
A vector of values |
digits |
How many digits to print |
less_than |
A value to add less than sign for |
more_than |
A value to add greater than sign for |
pad |
Whether to pad whitespace to force equal length strings |
A character vector
str_round(1.123, 2)
str_round(1.100, 2)
str_round(1.1000000, 2)
str_round(1.1000000, 3)
str_round(0.0000001, 3)
str_round(seq(0, 7, by = 1), 2, less_than = 2, more_than = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.