コード
func getComma(_ num: Int) -> String { let formatter = NumberFormatter() formatter.numberStyle = .decimal formatter.groupingSeparator = "," formatter.groupingSize = 3 let number = "¥\(formatter.string(from: NSNumber(value: num)) ?? "")" return number }