You need to perform string conversion in local mode, which will handle "2.5" and "2.5" correctly in accordance with the default locale. Try:
NSNumber *num=[NSDecimalNumber decimalNumberWithString:textField.text];
From Link to NSDecimalNumber Class :
Regardless of whether the NSDecimalSeparator period (as used, for example, in the USA) or a comma (used, for example, in France) depends on the default locale.
source share