Convert NSFileSystemSize to Gigabytes

Posted by AWright4911 on Stack Overflow See other posts from Stack Overflow or by AWright4911
Published on 2010-05-15T03:16:20Z Indexed on 2010/05/15 3:24 UTC
Read the original article Hit count: 295

Filed under:
|
|
|

I need to convert NSFileSystemSize to Gigabytes.

NSDictionary * fsAttributes = [ [NSFileManager defaultManager]
       fileSystemAttributesAtPath:NSTemporaryDirectory()];
NSNumber *totalSize = [fsAttributes objectForKey:NSFileSystemSize];
NSString *sizeInGB = [NSString stringWithFormat:@"\n\n %3.2f GB",[totalSize floatValue] / 107374824];

//returns 69.86 GB

any ideas why it doesnt return at leat 8.0GB's?

© Stack Overflow or respective owner

Related posts about size

Related posts about convert