I want to convert NSString to NSNumber without using the numbreFromString method :? The numbreFromString: metgod function acts weirdly in 4.0. Therefore, I want to use an alternative to convert NSString to NSNumber. Please help me....
+ (NSString *)formatText:(NSString *) text withLocalSettings:(BOOL) isLacale {
NSNumber *aNsNumber= [numberFormatter numberFromString: text];
NSString *returnString = [NSString stringWithString:[numberFormatter stringForObjectValue:aNsNumber]];
if(isLacale) {
return returnString;
}
else {
return [NSString stringWithFormat:@"%lf",[aNsNumber doubleValue]];
}
}
0
I am developing the application that I need to run my application in both versions 3.0 and 4.0. I have a text box where, when I try to enter numbers in the text box, the behavior looks like this ... IN 3.0: - It allows you to enter 7 digits and 2 fractional values (I formatted it like this). I formatted and localized the numbers along with commas depending on the selected country. It works great in versions 3.0 and 3.1.2
IN 4.0: - 4 , 5- . , u , u 6- , 1- , 4 . ex: - u 1234, - 1234, u 12345, "". u 6, 6 ..
NSNumberFormatter numberfromstring , .
, ... , ...