feat(can-payment): 다국적 통화 표기 지원 및 결제 금액 표시 개선

- KRW 고정 표기에서 벗어나 PG/해외 결제 등 다양한 통화 표기를 정확히 지원하기 위함
This commit is contained in:
Yu Sung
2025-10-02 17:17:17 +09:00
parent d045722b8d
commit 81b01722ac
4 changed files with 16 additions and 4 deletions

View File

@@ -44,4 +44,14 @@ extension String {
// - https://ios-development.tistory.com/379
}
func formatCurrency(currencyCode: String, locale: Locale = .current) -> String {
let formatter = NumberFormatter()
formatter.numberStyle = .currency
formatter.locale = locale
formatter.currencyCode = currencyCode
let dec = NSDecimalNumber(string: self)
return formatter.string(from: dec) ?? "\(currencyCode) \(self)"
}
}