Description Usage Arguments Value Examples
Truncate Decimal
1 2 3 4 5 6 7 | truncateDecimal(
x,
precision = 2,
suffix = NULL,
na.replace = 0,
tol = .Machine$double.eps^0.5
)
|
x |
numeric |
precision |
digits |
suffix |
character vector added to the end of the value |
na.replace |
na replace value. default is 0. |
tol |
tolerence |
character vector
1 2 3 4 5 | truncateDecimal(123.123, 2, "%") # returns 123.12%
truncateDecimal(123.123, 6, "%") # returns 123.123000%
truncateDecimal(2L, suffix = "%") # returns 2%
truncateDecimal(NA, suffix = "%")
truncateDecimal(NA, suffix = "%", na.replace = "")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.