I wanted to calculate that term:
(21000*(1.022^7-1))/(1.022-1)
R tells me, it's 157065.7. This was my answer to a task that I had to solve. It was stated that this answer is not correct, the correct answer should be 157065.67. Then I calculated this with my calculator on my smartphone and indeed, the solution was 157065.67034. I am really wondering what is wrong with R and whether I can change some options. I've tried options()$digits but that's 7, this can't be the problem...
One option:
formatC((21000*(1.022^7-1))/(1.022-1), digits = 11)
#> [1] "157065.67035"
Created on 2021-06-24 by the reprex package (v2.0.0)
Use options(digits = 15). Note that this changes globally the format. Also, the number of digits indicates all the digits (before and after the decimal separator).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With