0

I am presenting the user with a field that displays the number keyboard and only want them to be able to enter numbers with decimal it should be only one. After decimal it is should be atleast 2 digits will be there. There should be atleast one digit before the decimal.Then the input can`t be 0 or 0.00. Suppose if user enter the number 123456 it is accepted then 123.56 it also accepted if user enter 123 and then it it take 000123 and how can i take maximum length of the textfield is 6 and minimum is 1 please help me this one..

BenMorel
  • 30,280
  • 40
  • 163
  • 285
user900017
  • 5
  • 1
  • 2
  • possible duplicate of [Format Interger with two decimal format in UITextfield](http://stackoverflow.com/questions/7185092/format-interger-with-two-decimal-format-in-uitextfield) – zaph Aug 28 '11 at 11:16

1 Answers1

0

You need a regular expression for this task. This SO post should have an answer for you.

Community
  • 1
  • 1
Saran
  • 6,052
  • 3
  • 37
  • 43
  • if the user enters 1 it will take value 000001 is valid if user enters 123 it will take 000123 if he enter decimal is only one time second time is not valid 123.45 it is valid 1.2344 it is not valid please help me this one.... – user900017 Aug 28 '11 at 09:11