Re: [R] Fwd: trunc/floor a number -- strange bahaviour

2009-02-13 Thread Duncan Murdoch
I'm glad you are happy with your solution. Just one inline comment below, expanding on my private reply to you: Žroutík wrote: Resolved. nchar(unlist(strsplit(as.character(n),\\.)))[2] in the function: NumberPrecision - function(n) { PocetCyklu - 0 if(n != round(n)) { PocetCyklu -

Re: [R] Fwd: trunc/floor a number -- strange bahaviour

2009-02-13 Thread Žroutík
Thank you very much, Duncan! Now it is totally clear for me. Reading the 'R inferno' tract suggested to me in private by a user (nut one can google it), and wondering about heaven and hell Best regards, Z On Fri, Feb 13, 2009 at 1:05 PM, Duncan Murdoch murd...@stats.uwo.cawrote: I'm glad you

[R] Fwd: trunc/floor a number -- strange bahaviour

2009-02-12 Thread Žroutík
Resolved. nchar(unlist(strsplit(as.character(n),\\.)))[2] in the function: NumberPrecision - function(n) { PocetCyklu - 0 if(n != round(n)) { PocetCyklu - nchar(unlist(strsplit(n,\\.)))[2] } else { while(n == round(n)) { n - n/10 PocetCyklu - PocetCyklu + 1 } PocetCyklu - PocetCyklu - 1 #}