Skip to contents

[Stable]

Formats a count together with fraction with special consideration when count is less than 10.

Usage

format_count_fraction_lt10(x, ...)

Arguments

x

(numeric(2))
vector of length 2 with count and fraction, respectively.

...

not used. Required for rtables interface.

Value

A string in the format count (fraction %). If count is less than 10, only count is printed.

Examples

format_count_fraction_lt10(x = c(275, 0.9673))
#> [1] "275 (96.7%)"
format_count_fraction_lt10(x = c(2, 0.6667))
#> [1] "2"
format_count_fraction_lt10(x = c(9, 1))
#> [1] "9"