LengthFormatter does unexpected rounding
| Originator: | Nikita.Leonov | ||
| Number: | rdar://30341096 | Date Originated: | 02-Feb-2017 05:26 PM |
| Status: | Open | Resolved: | |
| Product: | HealthKit | Product Version: | |
| Classification: | Reproducible: | Always |
Area: HealthKit Summary: import HealthKit let formatter = LengthFormatter() formatter.isForPersonHeightUse = true formatter.unitStyle = .medium formatter.numberFormatter.roundingMode = .down formatter.numberFormatter.minimumFractionDigits = 0 formatter.numberFormatter.maximumFractionDigits = 0 formatter.string(fromValue: 11.9999999999999, unit: .inch) Steps to Reproduce: Run the code provided in a description Expected Results: the last string result will be "11 in" Actual Results: returned string is "12 in" Version: Xcode 8.2.1 Notes: Configuration: Playground
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!