Re: [Rd] rounding the time: significant 0 does not appear (PR#14075)

From: <macq_at_llnl.gov>
Date: Fri, 20 Nov 2009 05:25:09 +0100 (CET)


This is not a bug, and has nothing to do with times. For example:

> round(1.03,1)
[1] 1

Formatting is not the same as rounding. Perhaps you are assuming R formats numbers according to the concept of significant digits, but it doesn't. See the help page for the format function to get started with understanding R's rules for formatting numbers when it displays them. Maybe also some of the introductory R documents available on CRAN. -Don

At 3:45 AM +0100 11/20/09, gus1201_at_optimizelife.com wrote:
>Full_Name: Gustavo Lacerda
>Version: 2.9.1
>OS: Windows
>Submission from: (NULL) (137.82.157.97)
>
>
>I obtained 'time' by subtracting the results of two calls to sys.Time().
>
>
>> round(time,0)
>Time difference of 1 mins
>> round(time,1)
>Time difference of 1 mins
>> round(time,2)
>Time difference of 1.03 mins
>> round(time,3)
>Time difference of 1.032 mins
>
>
>Note that the second command above should return "1.0 mins", rather than "1
>min".
>
>______________________________________________
>R-devel_at_r-project.org mailing list
>https://*stat.ethz.ch/mailman/listinfo/r-devel

-- 
---------------------------------
Don MacQueen
Lawrence Livermore National Laboratory
Livermore, CA, USA
925-423-1062
macq_at_llnl.gov

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Fri 20 Nov 2009 - 04:30:15 GMT

This archive was generated by hypermail 2.2.0 : Fri 20 Nov 2009 - 07:10:40 GMT