[Swift] 가격을 천 단위로 콤마 들어가게 변경하기


[Swift] 가격을 천 단위로 콤마 들어가게 변경하기

func convertToCurrencyFormat(price:Int)->String{ let numberFormatter = NumberFormatter() numberFormatter.numberStyle = .decimal numberFormatter.maximumFractionDigits = 0 return numberFormatter.string(from: NSNumber(value: price)) ?? "" } [코드] 이렇게 return 시키면 된다. 5123450원 -> 5,123,450원...

[Swift] 가격을 천 단위로 콤마 들어가게 변경하기에 대한 요약내용입니다.

자세한 내용은 아래에 원문링크를 확인해주시기 바랍니다.


#swift #가격변화 #가격표현 #콤마추가

원문링크 : [Swift] 가격을 천 단위로 콤마 들어가게 변경하기