How can I tell R to round correctly?
问题 How can I tell R to round correctly? Decimal Places in R I have encountered a problem that I cannot figure out how to solve I want R to calculate 5/26*100 = 19.230769 x <- 5/26*100 x gives me: [1] 19.23077 Let's try to use round(), first setting the digits to 4: x <- round(5/26*100,digits=4) x gives: [1] 19.2308 Next, let's set the digits to 5: x <- round(5/26*100,digits=5) x gives: [1] 19.23077 Now, let's set the digits to 6: x <- round(5/26*100,digits=6) x gives: [1] 19.23077 Can anyone