swift - Print Double with two digits both before and after the decimal separator -
i'm trying print double format : 01.87 or 23.98.
i've found how print 2 digits after point don't found how print 2 digits before.
this code moment:
let str = nsstring(format: "%.2f", myvaluetoprint as! double)
how can print double 00.00?
use this:
let str = nsstring(format: "%05.2f", myvaluetoprint as! double)
Comments
Post a Comment