Refactor into -stringForTimeInterval: in SecondsFormatter.
This commit is contained in:
parent
a3398a1f07
commit
642717e405
2 changed files with 7 additions and 0 deletions
|
@ -24,4 +24,6 @@
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString * _Nullable)stringForTimeInterval:(NSTimeInterval)timeInterval;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -31,6 +31,11 @@
|
||||||
|
|
||||||
NSTimeInterval timeInterval = [object doubleValue];
|
NSTimeInterval timeInterval = [object doubleValue];
|
||||||
|
|
||||||
|
return [self stringForTimeInterval:timeInterval];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString * _Nullable)stringForTimeInterval:(NSTimeInterval)timeInterval;
|
||||||
|
{
|
||||||
if (isnan(timeInterval)) { return @"NaN"; }
|
if (isnan(timeInterval)) { return @"NaN"; }
|
||||||
if (isinf(timeInterval)) { return @"Inf"; }
|
if (isinf(timeInterval)) { return @"Inf"; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue