Skip to contents

Decimal Formatting

Usage

h_format_dec(digits = NA, format = NA)

Arguments

digits

(integer) number of digits.

format

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

Value

function formatting numbers with the defined format or NULL if the format is not defined.

Examples

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