
[Swift] 소수점 개수 설정하기 / 세 자리마다 콤마(,) 찍기 / NumberFormatter
·
Swift/개념 & 응용
안녕하세요. 개발하는 정주입니다. 오늘은 NumberFormatter에 대해 포스팅하려고 합니다. NumberFormatter는 굉장히 실용성이 높은 기능 중 하나인데요. 대표적으로 소수의 소수점 개수를 설정하거나 돈을 나타낼 때처럼 할 때 세 자리마다 콤마를 찍을 수 있습니다. 바로 알아보도록 하겠습니다. 공식 문서 애플의 공식 문서를 먼저 보겠습니다. https://developer.apple.com/documentation/foundation/numberformatter/ "A formatter that converts between numeric values and their textual representations."라고 되어있네요. 파파고의 힘을 빌려 번역해보면 "숫자 값과 텍스트 표현 사이..