powered by
This function is to derive the digit number after decimal point for a numeric variable (e.g., lat and long).
decimaldigit(x, dechar = ".", nint = NA, ndec = NA, pad.left = TRUE)
A list of integer number to show digit number after decimal point of x.
one or more decimal numbers.
The character used to separate the decimal part of a number.
The number of characters to which the integer part of the numbers should be padded.
The number of characters to which the decimal part of the numbers should be padded.
Whether the left (integer) side of the numbers should be padded as well as the right.
Jin Li
Jim Lemon and Philippe Grosjean (2019). 'prettyR': Pretty Descriptive Stats. R package version 2.1.1. https://CRAN.R-project.org/package=prettyR.
x<-c(0.1, 2.2, 3.03, 44.444, 555.0005, 6666.66666) decimaldigit(x)
Run the code above in your browser using DataLab