View source: R/cleaning_utils.R
pad_decimals | R Documentation |
Pad decimal places with trailing zeros.
pad_decimals(numbers, digits = NULL)
numbers |
A number or vector of numbers. |
digits |
Number of decimal places to pad. If NULL (default), uses the maximum number of decimal places in the numbers input. If digits is less than the number of decimal places in the data, rounds the data to the decimal place specified. If rounding at a 5, follows R's rules to round to the nearest even number. |
The original numbers, now as strings with trailing zeros added to the decimal places.
pad_decimals(c(2, 3.4, 8.808))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.