How to format a floating point number (Objective-C)

I would like to know how to format a floating point number.

Float Want to display 1.0 1 1.52 1.5 1.58 1.6 
+4
source share
1 answer

Will the format string @"%.1g" do this?

+5
source

Source: https://habr.com/ru/post/1299343/


All Articles