Call str. format(*args) with "{:. 2f}" as str and a float as *args to limit the float to two decimal places as a string.
Let me know how to round decimal for 2 decimal places in Objective-C.
I would like to do like this. (all of numbers following sentence is float value)
• round
10.118 => 10.12
10.114 => 10.11
• ceil
10.118 => 10.12
• floor
10.114 => 10.11
Thanks for checking my question.
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