# By default, the target width is that of
# the longest mantissa:
vec <- c(212, 75.38, 4.9625)
vec %>%
restore_zeros()
# Alternatively, supply a number via `width`:
vec %>%
restore_zeros(width = 6)
# For better printing:
iris <- tibble::as_tibble(iris)
# Apply `restore_zeros()` to all numeric
# columns, but not to the factor column:
iris %>%
restore_zeros_df()
# Select columns as in `dplyr::select()`:
iris %>%
restore_zeros_df(starts_with("Sepal"), width = 3)
Run the code above in your browser using DataLab