pretty_round: Round a value to a defined number of digits printing out...

View source: R/rounding.R

pretty_roundR Documentation

Round a value to a defined number of digits printing out trailing zeros, if applicable

Description

Round a value to a defined number of digits printing out trailing zeros, if applicable

Usage

pretty_round(x, digits = 0, sci_range = Inf, sci_sep = "e")

Arguments

x

The number to round.

digits

integer indicating the number of decimal places.

sci_range

See help for pretty_signif() (and you likely want to round with pretty_signif() if you want to use this argument).

sci_sep

The separator to use for scientific notation strings (typically this will be either "e" or "x10^" for computer- or human-readable output).

Details

Values that are not standard numbers like Inf, NA, and NaN are returned as "Inf", "NA", and "NaN".

Value

A string with the value.

See Also

round(), pretty_signif().


r-lib/prettyunits documentation built on March 9, 2024, 5:03 p.m.