spround: spround

View source: R/spround.R

sproundR Documentation

spround

Description

Round and specify knitted decimal places all in one step.

Usage

spround(x, digits = 2, leading0 = TRUE, less_than = FALSE)

Arguments

x

a numeric/character scalar or vector.

digits

a numeric scalar indicating the number of decimal places to round to.

leading0

a logical scalar indicating whether leading zeros should be included.

less_than

a logical scalar indicating whether rounded values equal to zero should be represented as less than a certain value (e.g., 0.000 becomes < .001).

Examples

spround(x = c(0.1078, 9.9930, 42.4242), digits = 2, leading0 = TRUE)
spround(x = c(0.1078, 9.9930, 42.4242), digits = 2, leading0 = FALSE)

camkay/panoply documentation built on Jan. 17, 2025, 6:31 a.m.