Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

printf in swift

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. 
 
PREVIOUS NEXT
Tagged: #printf #swift
ADD COMMENT
Topic
Name
8+9 =