Hi all,
I want to have a certain number of digits in all of the cells. I am currently using "str_pad" function from "stringr" library. This function generates numbers but does not cut them.
A=c(1,1.123,1.15545555555)
A=str_pad(A, 8,'right', pad = "0")
A
[1] "10000000" "1.123000" "1.15545555555"
This is what I got, but my desirable result is:
A
[1] "10000000" "1.123000" "1.155455"
Thanks,