Printf In Swift

[Solved] Printf In Swift | Swift - Code Explorer | yomemimo.com
Question : printf in swift

Answered by : jaynue

let x = 3.1415926
print(String(format: "%.2f", x)) //3.14
print(String(format: "%2.2f", x)) // 3.14 (two blank spaces in front of 3. 

Source : | Last Update : Wed, 02 Dec 20

Answers related to printf in swift

Code Explorer Popular Question For Swift