Skip to contents

Decimal Formatting

Usage

h_format_dec(digits, format, ne = FALSE)

Arguments

digits

(integer) number of digits.

format

(string) describing how the numbers should be formatted following the sprintf syntax.

ne

(flag) indicator whether to use "NE" to replace the actual value.

Value

function formatting numbers with the defined format.

Examples

fun <- h_format_dec(c(1, 1), "%s - %s")
fun(c(123, 567.89))
#> [1] "123.0 - 567.9"