Is your feature request related to a problem? Please describe.
Currently we have to give examples of how to use the function with vectors, e.g.
# On individual values
pretty_num(5789, gbp = TRUE)
pretty_num(564, prefix = "+/-")
# Applied over an example vector
vector <- c(3998098008, -123421421, "c", "x")
unlist(lapply(vector, pretty_num))
unlist(lapply(vector, pretty_num, prefix = "+/-", gbp = TRUE))
Describe the solution you'd like
Ability for the value argument to take a vector so that in the above example you could just do this instead:
# Applied over an example vector
vector <- c(3998098008, -123421421, "c", "x")
pretty_num(vector)
pretty_num(vector, prefix = "+/-", gbp = TRUE)
Describe alternatives you've considered
Could use other package functions or just leave as is, though it would be nice to make this function work given it's readability in code for the common ways we want to format numbers.
Additional context
We often format things like numbers in tooltips or axes of charts, these all usually come in vector form and would be made a lot neater by adapting the function to take individual numbers or vectors
Is your feature request related to a problem? Please describe.
Currently we have to give examples of how to use the function with vectors, e.g.
Describe the solution you'd like
Ability for the value argument to take a vector so that in the above example you could just do this instead:
Describe alternatives you've considered
Could use other package functions or just leave as is, though it would be nice to make this function work given it's readability in code for the common ways we want to format numbers.
Additional context
We often format things like numbers in tooltips or axes of charts, these all usually come in vector form and would be made a lot neater by adapting the function to take individual numbers or vectors