I have a text field where the user enters a number, which is in the range of thousands.
I want the text field to be formatted as the user enters the number, example :
200000 should become 200,000.
how do i go about doing this??
Many Thanks,
S
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I had the same question!
Here’s how you do it. You want to use NSNumberFormatter and set it to use Decimal style:
Replace textField with the name of your UITextField variable.