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