Two gigaseconds #147

Merged
JanX2 merged 30 commits from two-gigaseconds into master 2021-05-06 22:50:26 -04:00
Showing only changes of commit cb2dd0b75e - Show all commits

View file

@ -31,11 +31,17 @@
unsigned minutes = 0;
unsigned seconds = 0;
if(nil == object || NO == [object isKindOfClass:[NSNumber class]] || isnan([object doubleValue])) {
return @"";
if (nil == object || NO == [object isKindOfClass:[NSNumber class]]) {
// Docs state: Returns nil if object is not of the correct class.
return nil;
}
value = (unsigned)([object doubleValue]);
float floatValue = [object floatValue];
if (isnan(floatValue)) { return @"NaN"; }
if (isinf(floatValue)) { return @"Inf"; }
value = (unsigned)(floatValue);
seconds = value % 60;
minutes = value / 60;