nDecimal: Return the number of decimal points of a number

View source: R/rmd.util.r

nDecimalR Documentation

Return the number of decimal points of a number

Description

Trailing zeros are not counted.

Usage

nDecimal(x)

Arguments

x

(numeric or integer vector) a number vector

Value

(integer vector) numbers of decimal points, excluding trailing zeros, or NA if x is NA

Note

This is an internal function used in num2formattedStr

See Also

num2formattedStr

Examples

library(wfr)
nDecimal(c(1.010,0.3,NA))

blueskypie/wfr documentation built on Feb. 6, 2024, 4:38 p.m.