#!/usr/bin/env swift; import Foundation import Utils func main() -> Void { let S_FLOAT:String = "3.1415926" let S_INT:String = "3" let S_LONG:String = "123456789123456789" let a:Double = Double(S_FLOAT) ?? 0.0 let b:Int = Int(S_INT) ?? 0 let c:Int64 = Int64(S_LONG) ?? 0 let STR_A:String = String(a) let STR_B:String = String(b) let STR_C:String = String(c) print(Utils.format("sFloat as double: {0:f}", a)) print(Utils.format("sInt as int: {0:d}", b)) print(Utils.format("sLong as long: {0:d}", c)) print(Utils.format("a as string: {0:s}", STR_A)) print(Utils.format("b as string: {0:s}", STR_B)) print(Utils.format("c as string: {0:s}", STR_C)) exit(EXIT_SUCCESS) } main()