[R] round up a number to 10^4
Clint Bowman
clint at ecy.wa.gov
Tue Nov 1 20:55:18 CET 2011
Or does the middle number have two digits switched? 76131.17 would
round up to 80000 very nicely.
--
Clint Bowman INTERNET: clint at ecy.wa.gov
Air Quality Modeler INTERNET: clint at math.utah.edu
Department of Ecology VOICE: (360) 407-6815
PO Box 47600 FAX: (360) 407-7534
Olympia, WA 98504-7600
USPS: PO Box 47600, Olympia, WA 98504-7600
Parcels: 300 Desmond Drive, Lacey, WA 98503-1274
On Tue, 1 Nov 2011, David Winsemius wrote:
>
> On Nov 1, 2011, at 1:07 PM, Wendy wrote:
>
>> Hi all,
>>
>> I have a list of numbers, e.g., X = c(60593.23, 71631.17, 75320.1), and
>> want
>> to round them so the output is Y = c(60000, 80000, 80000).
>
> Under what notion of "rounding" would that be the result?
>
>> I tried
>> Y<-round(X,-4), but it gives me Y = c(60000, 70000, 80000). Do anybody know
>> how to round up a number to 10^4?
>>
>> Thank you in advance.
>
>
>
More information about the R-help
mailing list