I am presenting the user with a field that displays the number keyboard and only want them to be able to enter numbers--no decimals. Since the field is a currency field, however, I want the number to always display with two decimal places. You've probably seen this type of an interface at an ATM.
I've looked at the NSNumberFormatter docs and general formatting using [NSString stringWithFormat], but it's not clear to me a good way to do this. I am listening on the field with a selector for UIControlEventEditingChanged events. It's in that selector I want to do the formatting. When I use [NSString stringWithFormat: @"%.2f", amount], it always places amount to the left of the decimal. I want it to always be the fraction portion until the third digit is entered, so if the user types 32, the actual amount is .32. If the user enters 173, the value is actually 1.73. If the user enters 10047, the actual value should be 100.47 etc.
Any suggestions?
Thanks.