Round a number up to the number place second to the left. This is useful for reports that need rounded minimums and maximums.

round_up(x, format = "normal")

Arguments

x

A numeric value.

format

A boolean. Takes three different options to round up and stylize:

  • normal: The default, return the number with no formatting.

  • dollar: Return the number with a leading dollar sign along with commas.

  • comma: Return the number with commas.

Value

A numeric, or a string if format is not "normal".

Examples

if (FALSE) { # Round a number up round_up(123456) # Number with only 2 numeric places: round_up(19, format = "dollar") }