开发者

Decimal point issue on cocoa app

开发者 https://www.devze.com 2022-12-27 19:26 出处:网络
I there, I\'m trying making my first cocoa app,开发者_Go百科 but I\'m having problems with float numbers because of the regional settings.

I there, I'm trying making my first cocoa app,开发者_Go百科 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消