update remaining time string to display "not all available"

This commit is contained in:
Mitchell Livingston
2008-04-06 14:44:30 +00:00
parent 9f3f0c03e6
commit 3973647cff
2 changed files with 29 additions and 11 deletions
+3 -4
View File
@@ -66,9 +66,8 @@
}
//attempt to have minimum of 3 digits with at least 1 decimal
NSString * formattedSize = convertedSize < 10.0 ? [NSString localizedStringWithFormat: @"%.2f", convertedSize - .005]
: [NSString localizedStringWithFormat: @"%.1f", convertedSize - .05];
return [formattedSize stringByAppendingFormat: @" %@", unit];
return convertedSize < 10.0 ? [NSString localizedStringWithFormat: @"%.2f %@", convertedSize - .005, unit]
: [NSString localizedStringWithFormat: @"%.1f %@", convertedSize - .05, unit];
}
+ (NSString *) stringForSpeed: (float) speed
@@ -79,7 +78,7 @@
+ (NSString *) stringForSpeedAbbrev: (float) speed
{
if (speed < 1000.0) //0.0 K to 999.9 K
return [NSString localizedStringWithFormat: @"%.1f K", speed];
return [NSString localizedStringWithFormat: @"%.1f K", speed - .05];
else if (speed < 102400.0) //0.98 M to 99.99 M
return [NSString localizedStringWithFormat: @"%.2f M", (speed / 1024.0) - .005];
else if (speed < 1024000.0) //100.0 M to 999.9 M