Skip to contents

.p() is the same as .f(), but multiplies by 100 first (for percents). .fm() is the same as .f(), but puts braces around commas for use in latex math mode.

Usage

.f(x, digits)

.p(x, digits)

.fm(x, digits)

Arguments

x

A floating point number

digits

Number of decimals to display

Examples

runif(1) |> .f(2)
#> [1] "0.87"
runif(1) |> .p(2)
#> [1] "17.38"
runif(1, 100000, 200000) |> .fm(2)
#> [1] "135{,}625.40"