Learn R Programming

inTextSummaryTable (version 3.3.2)

getNDecimalsData: Get number of decimals based on the data in a numeric vector. Note: NA is returned if the element is missing (NA).

Description

Get number of decimals based on the data in a numeric vector. Note: NA is returned if the element is missing (NA).

Usage

getNDecimalsData(x)

Value

Numeric vector of same length than x

with the number of decimals.

Arguments

x

Numeric vector.

Author

Laure Cougnaud

See Also

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

Examples

Run this code
x <- c(0.99, 5.679, 50.45, 1450)
getNDecimalsData(x)

Run the code above in your browser using DataLab