0

I use UIKeyboardTypeDecimalPad for keyboardType. When I test in mac, I see button decimal in (.), but when I test in iPod, decimal button become (,). How can I fix this ? This is the code I tested:

self.rielPayTextField.keyboardType = UIKeyboardTypeDecimalPad;

2 Answers2

0

I guess it is a setting related to the 'Region Format' specified on your device. You can double check your settings going in 'Settings', 'General' and finally choosing 'International'

mariosangiorgio
  • 5,230
  • 4
  • 30
  • 45
  • After that, what can I do ? You mean this keyboardType cannot be shown in my region format ? –  Sep 04 '12 at 08:04
  • How can I use keyboard with decimal button (.) ? –  Sep 04 '12 at 08:08
  • Did you check whether the issue is related to the 'Region Format'? In that case I'd keep the default behavior as the keyboard is presenting the decimal separator expected by the user. – mariosangiorgio Sep 04 '12 at 08:08
  • Is there any help ? Should I need to customize keyboard number pad ? –  Sep 05 '12 at 02:04
0

The thread may be a little older, but here's what I experienced: The "." and "," depend on your regional setting of your iDevice. I'm in Germany, so the decimal separator is "," and it showed on the numberpad. When switching the region and language settings (my app is 4-lingual) to english, I had the "." decimal separator. So your numberpad should be fine, as long as you work with decimals. Only thing you have to care about is to check the number that was entered by the user. You have to make sure to use nslocalized number so that the input gets properly converted to be handled by your app. A double uses "." as separator, so entering a decimal of 3,4 in German would result in errors as the colon is not recognized as decimal separator. I hope this helps.

Mike73
  • 51
  • 6