Skip to contents

[Experimental]

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

Usage

format_count_fraction_fixed_dp(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 0, the format is 0.

Examples

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