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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -