The fmt_percent() function

Use a summarized version of the pizzaplace dataset to create a gt table. With fmt_percent(), we can format the frac_of_quota column to display values as percentages (to one decimal place).

pizzaplace |>
  dplyr::mutate(month = as.numeric(substr(date, 6, 7))) |>
  dplyr::count(month, name = "pizzas_sold") |>
  dplyr::mutate(frac_of_quota = pizzas_sold / 4000) |>
  gt(rowname_col = "month") |>
  fmt_percent(
    columns = frac_of_quota,
    decimals = 1
  )
pizzas_sold frac_of_quota
1 4232 105.8%
2 3961 99.0%
3 4261 106.5%
4 4151 103.8%
5 4328 108.2%
6 4107 102.7%
7 4392 109.8%
8 4168 104.2%
9 3890 97.2%
10 3883 97.1%
11 4266 106.7%
12 3935 98.4%