fmt_pct: Format numbers as percentages

View source: R/summarizor.R

fmt_pctR Documentation

Format numbers as percentages

Description

Format numeric values as percentages (e.g. "45.0%").

Usage

fmt_pct(x)

Arguments

x

numeric values

See Also

tabulator(), mk_par()

Other value formatters: fmt_2stats(), fmt_avg_dev(), fmt_dbl(), fmt_header_n(), fmt_int(), fmt_n_percent(), fmt_signif_after_zeros()

Examples

library(flextable)

df <- data.frame(zz = .45)

ft_1 <- flextable(df)
ft_1 <- mk_par(
  x = ft_1, j = 1, part = "body",
  value = as_paragraph(as_chunk(zz, formatter = fmt_pct))
)
ft_1 <- autofit(ft_1)
ft_1

flextable documentation built on June 2, 2026, 9:08 a.m.