Re: string to float

2008-07-04 Thread Gary L. Wade
If you've already parsed the text, just use NSNumber's class method +numberWithDouble (or whichever other method is appropriate for your needs). If you don't want to use your own parser, you can use NSScanner on your text, but make sure you've set the locale to correctly interpret the comma.

Re: string to float

2008-07-04 Thread Devon Ferns
What about replacing the , with a . and using NSString's floatValue function? Devon Robert Cerny wrote: Hi folks, I made a parser, which returns values like 10,45. It means, it has comma as a decimal point delimiter, which is correct in my language. I was trying to find a way to convert to N

Re: string to float

2008-07-04 Thread Jean-Daniel Dupas
Le 4 juil. 08 à 17:15, Robert Cerny a écrit : Hi folks, I made a parser, which returns values like 10,45. It means, it has comma as a decimal point delimiter, which is correct in my language. I was trying to find a way to convert to NSNumber. Is it correct the the right way is to use NSSca

string to float

2008-07-04 Thread Robert Cerny
Hi folks, I made a parser, which returns values like 10,45. It means, it has comma as a decimal point delimiter, which is correct in my language. I was trying to find a way to convert to NSNumber. Is it correct the the right way is to use NSScanner? Robert _