Format numbers as percent

fmt_percent(digits = 1)

Arguments

digits

How many digits to print.

Value

An object you can pass into number_format().

See also

Other format functions: fmt_pretty()

Examples

jams$Sugar <-c ("Sugar content", 0.4, 0.35, 0.45) set_number_format(jams, -1, "Sugar", fmt_percent(1))
#> Type Price Sugar content #> Strawberry 1.90 40.0% #> Raspberry 2.10 35.0% #> Plum 1.80 45.0% #> #> Column names: Type, Price, Sugar