Created
July 27, 2009 08:06
-
-
Save lukhnos/156100 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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