From 1ed9e77dff7bd74b04d6dc35849b6b644f11e2d5 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Thu, 9 Apr 2009 21:11:17 +0000 Subject: - Improve time interval granularity for times below 10 seconds (show two decimal places instead of one) --- Source/SPStringAdditions.m | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Source/SPStringAdditions.m') diff --git a/Source/SPStringAdditions.m b/Source/SPStringAdditions.m index 2c719f6c..e0bf65cf 100644 --- a/Source/SPStringAdditions.m +++ b/Source/SPStringAdditions.m @@ -83,6 +83,12 @@ return [numberFormatter stringFromNumber:[NSNumber numberWithFloat:timeInterval]]; } + if (timeInterval < 10) { + [numberFormatter setFormat:@"#,##0.00 s"]; + + return [numberFormatter stringFromNumber:[NSNumber numberWithFloat:timeInterval]]; + } + if (timeInterval < 100) { [numberFormatter setFormat:@"#,##0.0 s"]; -- cgit v1.2.3