Original implementation from https://stackoverflow.com/questions/5173692/how-to-return-number-of-decimal-places-in-r

decimalplaces(x, true_number = FALSE)

Arguments

x

Float or double numeric number.

true_number

Logical setting whether the true number (see notes) of decimal places.

Value

Integer number of decimal places. Maximum

Note

R usually restricts the number of decimal to 9 in printing etc. Unless true_number = TRUE, return 9 and give a warning.