Returns the number of decimal places in the vector x. x must be a character and contain formatted numbers.
Usage
Ndec(x)
Prec(x)
Arguments
x
is a character vector containing formatted numbers
Value
an integer value.
Details
The function is currently defined as:
Ndec <- function(x) {
stopifnot(class(x)=="character")
res <- rep(0, length(x))
x <- gsub(pattern="[eE].+$", rep="", x=x)
res[grep("\.",x)] <- nchar( sub("^.+[.]","",x) )[grep("\.",x)]
return(res)
}