-
-
Notifications
You must be signed in to change notification settings - Fork 287
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
fix: 3723 - now always replaces decimal separator for number format #3734
fix: 3723 - now always replaces decimal separator for number format #3734
Conversation
This reverts commit ad46236.
# Conflicts: # packages/smooth_app/pubspec.lock # packages/smooth_app/pubspec.yaml
Impacted files: * `strings_helper.dart`: removed now useless methods * `text_input_formatters_helper.dart`: now works in all cases, regardless of the presence of group separator in the target language, given that we don't use group separators in our decimal number formats anyway
Thank you very much @monsieurtanuki |
@@ -107,10 +103,9 @@ class DecimalSeparatorRewriter extends TextInputFormatter { | |||
/// Replaces a "." by a "," or a "," by a "." only if | |||
/// the group separator is an empty character |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the comment about the group separator being an empty character should now be removed I guess
/// | ||
/// Also, if a separator is already displayed, it will be move to the new | ||
/// Also, if a separator is already displayed, it will be moved to the new | ||
/// position | ||
class DecimalSeparatorRewriter extends TextInputFormatter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to have unit tests for those functions, as it would be easy to break something that works today in future changes.
Impacted files:
strings_helper.dart
: removed now useless methodstext_input_formatters_helper.dart
: now works in all cases, regardless of the presence of group separator in the target language, given that we don't use group separators in our decimal number formats anywayWhat
en_US
, it was disabled.6,85
which in US was parsed as685
.,
(and decimal is.
) the string fix was problematic.,
device and a.
app. Typically, when the user is (was) able to type6,85
while the app language was set toen_US
.Fixes bug(s)