Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Structures and Classes
- 독후감
- SWIFTUI
- Failed to register bundle identifier
- human interface guidelines
- Info.plist
- mvvm
- SWIFT
- 아이폰
- 스타트업주니어로살아남기
- roundingMode
- UIResponder
- 독서후기
- View Life Cycle
- NotificationCenter
- IOS
- NumberFormatter
- Modality
- 책후기
- contentInset
- Mock
- viewcontroller
- 부트캠프
- 야곰아카데미
- 스위프트
- Navigation
- delegation
- @available
- Codegen
- xcode
Archives
- Today
- Total
목록NumberFormatter (1)
호댕의 iOS 개발
NumberFormatter를 보면 지정한 소수점에 맞춰 어떻게 올림, 버림, 반올림을 할 지 정할 수 있는 인스턴스 프로퍼티가 존재한다. 제목에도 나와있듯 roundingMode가 바로 그것이다. 여기서는 7가지 종류로 어떻게 소수점을 처리할 지 정할 수 있다. .up .down .ceiling .floor .halfUp .halfDown .halfEven 그렇다면 각각 어떤 식으로 소수점을 처리하는 것일까? .up Round away from zero. 0으로 부터 멀어지도록 소수점을 처리하게 된다. 즉 음수일 때는 작아지는 방향으로, 양수일 때는 커지는 방향으로 소수점을 처리한다. 만약 let numberFormatter = NumberFormatter() numberFormatter.maximum..
Software Engineering/Swift
2021. 11. 21. 21:33