// 여기서 파라미터 타입은 String임
func formatPriceWithCommas(_ stringPrice: String?) -> String {
if let stringPrice = stringPrice {
let numberFormatter = NumberFormatter()
numberFormatter.numberStyle = .decimal
let price = Int(stringPrice) ?? 0
let result = numberFormatter.string(from: NSNumber(value:price))!
return "\(result)원"
} else {
return "원"
}
}