Displaying 1 result from an estimated 1 matches for "cround".
Did you mean:
around
2003 Jun 02
2
Rounding problem R vs Excel
For numbers ending in 5 Excel always rounds up and I want to reproduce this in R rather than use the round function.
I have tried:
x<-as.integer(x*100+0.5)/100
and
x<-floor(x*100+0.5)/100
However, some values of x cause problems e.g
x<-floor(4.145*100+0.5)/100
4.14
I have tried breaking it down into steps and force the results to 10 significant figures in the following function,