roundx_n | R Documentation |
Round value based on magnitude
roundx_n(x)
x |
A numeric value to be rounded. Values >= 100 are rounded to 1 decimal place. Values < 100 and >=1 are rounded to two decimal places. Values <1 are rounded to three decimal places. |
A numeric value rounded based on the magnitude of x
library(curios) # Note: R will display right padded zero's below. This is a display manifestation only. roundx_n(c(0.1234, 1.1234, 100.123)) # Verify rounding does not add right hand padding roundx_n(c(0.1234, 1.1234, 100.123))[3]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.