[R] number of decimal places in a number?

Martin Ivanov tramni at abv.bg
Sat Jul 7 10:52:35 CEST 2012


 Dear R users,

I need a function that gets a number and returns its number of actual decimal places.
For example f(3.14) should return 2, f(3.142) should return 3, f(3.1400) should also return 2
and so on. Is such function already available in R? If not, could you give me a hint how to achieve that?

Many thanks in advance.

-----------------------------------------------------------------
Гражданска отговорност – Цените на компаниите
http://www.sdi.bg/onlineInsurance/?utm_source=gbg&utm_medium=txtLink&utm_content=home



More information about the R-help mailing list