formatPercentage {inTextSummaryTable}R Documentation

Format a percentage.

Description

The following rules are used:

Usage

formatPercentage(x, nDec = 1)

Arguments

x

Numeric vector with percentage(s)

nDec

Integer of length 1, number of decimals used to round the percentage, 1 by default.

Value

String with formatted percentage

Author(s)

Laure Cougnaud

See Also

Other decimals: getMaxNDecimals(), getMaxNDecimalsData(), getNDecimals(), getNDecimalsData()

Examples

xPerc <- c(NA, 0, 100, 99.95, 0.012, 34.768)
formatPercentage(x = xPerc)

[Package inTextSummaryTable version 3.3.2 Index]