0

I am trying to have sum of two values in R with 6 decimal places but it only returns with 5.

85.85+0.01302778
# [1] 85.86303

I tried

round(85.85+0.01302778,6) 

but it does not work.

Actually sum(85.85,0.01302778) gives only 5 decimals and I did not find any scope of decimal places in ?sum.

Any suggestions

mnel
  • 113,303
  • 27
  • 265
  • 254
badu_cool
  • 5
  • 1
  • 4
  • 2
    See [Controlling digits in R](http://stackoverflow.com/questions/2287616/controlling-digits-in-r) -- it is how the object is printed. try `print(85.85+0.01302778, digits = 10)` – mnel Aug 07 '13 at 06:32

1 Answers1

0

Try this to get 6 digits:

> options(digits=8)
> 85.85+0.01302778
[1] 85.863028
maximus
  • 11,264
  • 30
  • 93
  • 124