From d8b67b5c210fcddf510f1b2f3a4b63a6c4516d55 Mon Sep 17 00:00:00 2001 From: Mathias Claassen Date: Thu, 2 Jun 2016 13:46:25 -0300 Subject: [PATCH] Fix decimal number formatting. closes #514 --- XLForm/XL/Cell/XLFormTextFieldCell.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XLForm/XL/Cell/XLFormTextFieldCell.m b/XLForm/XL/Cell/XLFormTextFieldCell.m index e766a37f..6dc3fb24 100644 --- a/XLForm/XL/Cell/XLFormTextFieldCell.m +++ b/XLForm/XL/Cell/XLFormTextFieldCell.m @@ -331,7 +331,7 @@ - (void)textFieldDidChange:(UITextField *)textField{ if (!didUseFormatter) { if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeNumber] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeDecimal]){ - self.rowDescriptor.value = @([self.textField.text doubleValue]); + self.rowDescriptor.value = [NSDecimalNumber decimalNumberWithString: self.textField.text]; } else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeInteger]){ self.rowDescriptor.value = @([self.textField.text integerValue]); } else {