Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add Decimal Separator character to iOS keyboard Number Pad?

Tags:

How can I create a number pad with a decimal point separator character option in Xcode's Interface Builder Storyboard?

Changing Keyboard Type to Number Pad doesn't show a decimal option:

Keyboard Type > Number Pad

Keyboard Type > Number Pad

like image 994
Baub Avatar asked Aug 31 '11 19:08

Baub


People also ask

How do you add decimal places on iPhone?

Here's a longer answer: on an iPhone, you enter decimals by pressing the +*# button in the lower-left corner of the keypad and pressing either * or #.

How do I change commas to decimals on iPhone?

Have figured it out with the help of Ross at the V & A Waterfront Apple Store. System Preferences- Language and Region- at the bottom of the box click "Advanced"- then choose the dot/ comma under Number separators- Decimal and again under drop down box "decimal" under currency. Good job!

How do you use decimals on a keyboard?

The decimal key can appear in two places on the US keyboard, in the bottom row of main keys to the right of 'M', or in an optional numeric keypad. The behavior should be the same regardless of which key is used to enter a decimal.


1 Answers

In iOS 4.1, there is a number pad with a decimal point available. You can select it programatically (in case you are supporting versions of iOS before 4.1) like so:

inputBoxTextField.keyboardType = UIKeyboardTypeNumbersAndPunctuation; if (([[[UIDevice currentDevice] systemVersion] doubleValue] >= 4.1)) {     inputBoxTextField.keyboardType = UIKeyboardTypeDecimalPad; } 

You could choose any appropriate keyboard type (line 1). In this case, NumbersAndPunctuation includes a period in case the user's iOS version is before 4.1.

like image 171
Mark Granoff Avatar answered Nov 01 '22 23:11

Mark Granoff