1 #ifndef UICABOODLE_UCSTRING_H
2 #define UICABOODLE_UCSTRING_H
4 #import <Foundation/NSString.h>
6 @interface
NSString (UICaboodle
)
7 + (NSString
*) stringWithDataSize
:(double)size
;
10 @implementation
NSString (UICaboodle
)
12 + (NSString
*) stringWithDataSize
:(double)size
{
19 static const char *powers_
[] = {"B", "KiB", "MiB", "GiB"};
21 return [NSString stringWithFormat
:@
"%.1f%s", size
, powers_
[power
]];
26 #endif/*UICABOODLE_UCSTRING_H*/