Show actual percentage in label
The label was showing stuff like 6000% which is not relevant if it says the % or maybe %%%. Anyway I feel this way it is better for a default use?
Showing
1 changed file
with
2 additions
and
2 deletions
| @@ -157,7 +157,7 @@ displayCountingLabel:(BOOL)displayCountingLabel | @@ -157,7 +157,7 @@ displayCountingLabel:(BOOL)displayCountingLabel | ||
| 157 | [_circle addAnimation:pathAnimation forKey:@"strokeEndAnimation"]; | 157 | [_circle addAnimation:pathAnimation forKey:@"strokeEndAnimation"]; |
| 158 | _circle.strokeEnd = [_current floatValue] / [_total floatValue]; | 158 | _circle.strokeEnd = [_current floatValue] / [_total floatValue]; |
| 159 | 159 | ||
| 160 | - [_countingLabel countFrom:0 to:[_current floatValue] withDuration:self.duration]; | 160 | + [_countingLabel countFrom:0 to:[_current floatValue]/([_total floatValue]/100.0) withDuration:self.duration]; |
| 161 | 161 | ||
| 162 | 162 | ||
| 163 | // Check if user wants to add a gradient from the start color to the bar color | 163 | // Check if user wants to add a gradient from the start color to the bar color |
| @@ -235,4 +235,4 @@ displayCountingLabel:(BOOL)displayCountingLabel | @@ -235,4 +235,4 @@ displayCountingLabel:(BOOL)displayCountingLabel | ||
| 235 | _total = total; | 235 | _total = total; |
| 236 | } | 236 | } |
| 237 | 237 | ||
| 238 | -@end | 238 | +@end |
-
Please register or login to post a comment