Skip to content

Instantly share code, notes, and snippets.

@lukhnos
Created July 27, 2009 08:06
Show Gist options
  • Save lukhnos/156100 to your computer and use it in GitHub Desktop.
Save lukhnos/156100 to your computer and use it in GitHub Desktop.
@interface NSString (LocalizedDoubleValue)
- (double)localizedDoubleValue;
@end
@implementation NSString (LocalizedDoubleValue)
- (double)localizedDoubleValue
{
NSScanner *scanner = [NSScanner localizedScannerWithString:self];
double newValue = 0.0;
[scanner scanDouble:&newValue];
return newValue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment