[R] rounding format

jim holtman jholtman at gmail.com
Wed Jan 2 19:50:45 CET 2008


> sprintf("%.4f", 0.0002234)
[1] "0.0002"


On Jan 2, 2008 1:45 PM, array chip <arrayprofile at yahoo.com> 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
>
>
>      ____________________________________________________________________________________
> Looking for last minute shopping deals?
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?




More information about the R-help mailing list