While playing around, I found the round() function in swift. It can be used as below:
round(0.8)
Which will return 1, as expected. Here's my question:
how do I round by thousandths in swift?
I want to be able to plug in a number, say 0.6849, and get 0.685 back. How does round() do this? Or, does it not, in which case, what function does?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…