[R] How many digits are there in left of dot of 0.0001 ?

JS Huang js.huang at protective.com
Thu Feb 26 13:12:17 CET 2015


Hi, 
  
  Some modification to work for both positive and negative number:

nchar(format(*abs*(a),scientific=FALSE))-(trunc(log10(max(1,trunc(abs(a)))))+1)
-1.



--
View this message in context: http://r.789695.n4.nabble.com/How-many-digits-are-there-in-left-of-dot-of-0-0001-tp4703842p4703872.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list