Javaのstring.formatに似たようなのを探したらあった
swift - String formatting of a Double - Stack Overflow http://stackoverflow.com/questions/24047374/string-formatting-of-a-double
var str = NSString(format: "%.2f", 42.12312312313)
結果
42.12
Go to list of users who liked
More than 5 years have passed since last update.
Javaのstring.formatに似たようなのを探したらあった
swift - String formatting of a Double - Stack Overflow http://stackoverflow.com/questions/24047374/string-formatting-of-a-double
var str = NSString(format: "%.2f", 42.12312312313)
結果
42.12
Register as a new user and use Qiita more conveniently
Go to list of users who liked