First, I setup up the keyboard for the UITextField to use the number with decimal style. So the user can only enter numbers and a single decimal.
What I want to do i
Good! If someone need it working with non-US currencies: euro or other ones with fraction separated by comma instead of dot use this one:
NSString *expression = @"^([0-9]+)?([\\,\\.]([0-9]{1,2})?)?$";
The only difference is that it allows comma or dot. ([\,\.] - either . or ,) Only trick is that you need to replace comma with dot when using your acquired number, because computer uses dot to separate fraction, not the comma.