fmt_signif_after_zeros: Format with significant figures after zeros

View source: R/summarizor.R

fmt_signif_after_zerosR Documentation

Format with significant figures after zeros

Description

Rounds significant figures after zeros in numeric vectors. The number of digits displayed after the leading zeros is customizable using the digits parameter.

Usage

fmt_signif_after_zeros(x, digits = 3)

Arguments

x

numeric values

digits

number of digits displayed after the leading zeros

See Also

tabulator(), mk_par()

Other text formatter functions: fmt_2stats(), fmt_avg_dev(), fmt_dbl(), fmt_header_n(), fmt_int(), fmt_n_percent(), fmt_pct()

Examples

x <- data.frame(
  x = c(0.00000004567, 2.000003456, 3, pi)
)
ft_1 <- flextable(x)
ft_1 <- align(x = ft_1, j = 1, align = "left")
mk_par(ft_1, value = as_paragraph(
  fmt_signif_after_zeros(x)))

flextable documentation built on Oct. 30, 2024, 9:15 a.m.