start here: Limit the entry of two points

And you can force DecimalPad: 1. immediately enter a comma instead of a comma? 2. check that there are no duplicate points / commas?

After all, DecimalPad was created to ensure that in the field where only numbers are needed, enter only digits and a separator! And it turns out, you also need to check that you have another country and a comma instead of a full stop. And that can double-click point.

The comma / period on the keyboard appears clearly when the country changes. And when you have the States, you do not need to check for a comma. But if Russia - a comma appears. Maybe this check is somehow implemented by localization?

Well, with two points the question remains ...

    1 answer 1

    NSDecimalNumber has a method -initWithString:locale: you can convert them, it will help you to get rid of the comma-dot check.

    Regarding the test for two points - on the Internet, nothing smart can offer, except for what you already have.