[swift-users] How to print formated "%.9f" Double? Swift 2.2 ?

Isaac Gouy igouy2 at yahoo.com
Thu Dec 10 15:39:46 CST 2015


For example,

   print( String(format: "%.3f", 1.23489) )

   $ /usr/local/src/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/bin/swiftc test.swift

   $ ./test
   ("%.3f", 1.23489)

Not 1.235


More information about the swift-users mailing list