Re: [R] print only 2 digits of number

2010-09-29 Thread Henrique Dallazuanna
Try this: trunc(x / 10 ^ nchar(x) * 100) On Wed, Sep 29, 2010 at 11:18 PM, Christian Schoder wrote: > hi R-users! > > does anyone know how I can access/print only the first two digits of a > number? if i have the number 23732, i would like to get 23. if i have > 355 i would like to get 35. if i

Re: [R] print only 2 digits of number

2010-09-29 Thread Peter Langfelder
On Wed, Sep 29, 2010 at 7:18 PM, Christian Schoder wrote: > hi R-users! > > does anyone know how I can access/print only the first two digits of a > number? if i have the number 23732, i would like to get 23. if i have > 355 i would like to get 35. if i have 4 i would like to get 40. It's a stran

[R] print only 2 digits of number

2010-09-29 Thread Christian Schoder
hi R-users! does anyone know how I can access/print only the first two digits of a number? if i have the number 23732, i would like to get 23. if i have 355 i would like to get 35. if i have 4 i would like to get 40. thanks for your help! christian _