-
-
Notifications
You must be signed in to change notification settings - Fork 953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decimal local separator #452
Comments
I find a solution by replacing
with the following lines
It's not the perfect solution but it finally get the correct double value. |
Same problem for me. The bug fix is simple but need to be merged in pod so everyone can use it without forking the project. |
+1 |
NSFormatter support was merged. |
This is not solved. Other separators than '.' are not respected.
To respect the current locale it should read (according to this):
I will create a pull request... no. 31 as of now :| |
[fixes #452] respect the currentLocale when parsing decimal values
This fix does not help fully. If I have set value to, e.g., "12,34" it is converting to "12.34" after I get out of this field. Using NSNumberFormatter helps to avoid this transformation, however It can't help me with changing this value to dot-format after I select this field again. With |
The smoothest solution is to use 2 number formatters - one in form row and one as extension for NSNumber, which helps to call
|
* master: (27 commits) Add property in XLFormTextViewCell to limit number of characters Add property in XLFormTextFieldCell to limit number of characters change XLFormUnspecifiedHeight constant to not collide with Automatic dimension datePicker.locale property public to developer,for example, _birthdayRow = [XLFormRowDescriptor formRowDescriptorWithTag:kBirthdayTag rowType:XLFormRowDescriptorTypeDateInline title:@"Birthday"]; [_birthdayRow.cellConfig setObject:[[NSLocale alloc] initWithLocaleIdentifier:@"en"] forKey:@"locale"]; Refactored '-(id)init' to '- (instancetype)init' Update 'initializeForm' example. Update pod badge [fixes xmartlabs#452] respect the currentLocale when parsing decimal values Remove the fix for suppressing "Empty snapshot" warnings when presenting action sheets Updated code to actually use the optionTitle variable Fixed selector action sheet to use the row's value transformer update pod version added count to empty check. Helpful to validate multiple selectors being empty Fix decimal number formatting. closes xmartlabs#514 Added height property to XLFormRowDescriptor updated readme with some comments. Fixes xmartlabs#771, fixes xmartlabs#727, fixes xmartlabs#696 Add support for NSFormatter Do validation can be nullable. fixes xmartlabs#705 fix crash when using cell style Value2. closes xmartlabs#770 Fix when the textFieldPercentage is applied. Closes xmartlabs#776 ...
Hi,
As french people, I use a comma instead of point as decimal separator ...
When I use a
XLFormRowDescriptorTypeDecimal
row, it displays a decimal keyboard with comma which is great for amount fields.But as I noticed the
-[NSString doubleValue]
isn't respecting the locale decimal separator; it expects a point, not a comma.So finally my value isn't correct.
Is there a trick to parse correctly my amount value ?
Thanks a lot.
The text was updated successfully, but these errors were encountered: