Skip to contents

[Stable]

Formats a count together with fraction with special consideration when count is 0.

Usage

format_count_fraction(x, ...)

Arguments

x

(integer)
vector of length 2, count and fraction.

...

required for rtables interface.

Value

a string in the format count (fraction %). If count is 0 the format is 0.

Examples

format_count_fraction(x = c(2, 0.6667))
#> [1] "2 (66.7%)"
format_count_fraction(x = c(0, 0))
#> [1] "0"