views:

39

answers:

1

I there, I'm trying making my first cocoa app, but I'm having problems with float numbers because of the regional settings.

If I write on the TextBox the float number 1.2 I only can get the number 1, but If I write on the same TextBox the same float number but this time with the ',' sign instead (1,2) I can get the right float value.

How can I bypass the regional settings?

Kind Regards, Manuel Rocha

+4  A: 

You don't want to bypass the regional settings, you want to use a NSNumberFormatter to convert the string in the TextBox to a number.

Shawn Craver
I know it seems like a pain but you won't believe how many problems you will bypass by learning how to use NSNumberFormatter.
willc2