From my understanding the input should be converted to character without specifying
"x = ...character vector, or a vector to be coerced to a character vector"
nchar(2015122514204000000)
# 18
nchar("2015122514204000000")
# 19
# Replacing the end zeroes with 111111
nchar(2015122514204111111)
# 19
It is doing the following:
as.character(2015122514204000000)
"2.015122514204e+18"
and
nchar("2.015122514204e+18")
is 18.
Try e.g. options(scipen=999) to prevent scientific notation, and nchar(2015122514204000000) will return 19. Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With