Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

format decimal place swift

let tip: Double = 15.2847320
let tipText: String = String(format: "%.2f", tip)
// %.2f for two decimal places
Source by www.hackingwithswift.com #
 
PREVIOUS NEXT
Tagged: #format #decimal #place #swift
ADD COMMENT
Topic
Name
2+5 =