지난번 타이머를 만들면서 이런저런 자료들을 참고하다보니 String(format: "%.2f", number) 이런식으로 사용한것들이 눈에 보이길래 자세히 알아봤습니다. https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFStrings/formatSpecifiers.html#//apple_ref/doc/uid/TP40004265 String Format Specifiers Format Specifiers The format specifiers supported by the NSString formatting methods and CFString formatting functions follow the IEEE printf specification ; the specifiers are summarized in Table 1 . Note that you can also use the “...
원문 링크 : [Swift] String Format Specifiers