Closed AnthonyWhitakerJr closed 8 years ago
Accomplished with: let odds = reward.dropOdds!100 let oddsString = odds.truncatingRemainder(dividingBy: 1) == 0 ? "(Int(round(odds)))%" : "(round(odds \ 10) / 10)%"
Considered String.format but if we are going to need rounding anyway, may as well do it like this.
When displaying drop percentage for rewards, display a single number after the decimal iff it is significant.
25.3% - YES 2% - YES 2.0% - NO