format_fraction_fixed_dp: Format fraction and percentage with fixed single decimal...

View source: R/formatting_functions.R

format_fraction_fixed_dpR Documentation

Format fraction and percentage with fixed single decimal place

Description

[Stable]

Formats a fraction together with ratio in percent with fixed single decimal place. Includes trailing zero in case of whole number percentages to always keep one decimal place.

Usage

format_fraction_fixed_dp(x, ...)

Arguments

x

(named integer)
vector with elements num and denom.

...

not used. Required for rtables interface.

Value

A string in the format ⁠num / denom (ratio %)⁠. If num is 0, the format is num / denom.

See Also

Other formatting functions: extreme_format, format_auto(), format_count_fraction(), format_count_fraction_fixed_dp(), format_count_fraction_lt10(), format_extreme_values(), format_extreme_values_ci(), format_fraction(), format_fraction_threshold(), format_sigfig(), format_xx(), formatting_functions

Examples

format_fraction_fixed_dp(x = c(num = 1L, denom = 2L))
format_fraction_fixed_dp(x = c(num = 1L, denom = 4L))
format_fraction_fixed_dp(x = c(num = 0L, denom = 3L))


tern documentation built on Sept. 24, 2024, 9:06 a.m.