Re: [R] rounding format

2008-01-02 Thread Prof Brian Ripley
On Wed, 2 Jan 2008, jim holtman wrote: >> sprintf("%.4f", 0.0002234) > [1] "0.0002" Or, literally for printing, use options(scipen=). Note that round(0.0002234,4) does return (a representable number very close to) 0.0002, but it is printed by default as 2e-04. > round(0.0002234,4) [1] 2e-04 >

Re: [R] rounding format

2008-01-02 Thread jim holtman
> sprintf("%.4f", 0.0002234) [1] "0.0002" On Jan 2, 2008 1:45 PM, array chip <[EMAIL PROTECTED]> wrote: > Hi, > > The code round(0.0002234,4) will return 2e-04, how can > I return 0.0002 instead? I want to print 0.0002 > instead of 2e-04 for formating purpose. > > thanks > > > > ___

[R] rounding format

2008-01-02 Thread array chip
Hi, The code round(0.0002234,4) will return 2e-04, how can I return 0.0002 instead? I want to print 0.0002 instead of 2e-04 for formating purpose. thanks Looking for last minute shopping deals?