Description:
In Brazil and other countries using "," as a decimal separator, it's common for users to input both "," and "." to represent the decimal point. However, when displaying values, it's preferable to always use "," as the decimal separator.
Currently, the code logic only detects the occurrence of ",." as an incorrect separator. However, in our case, we also need to consider the possibility of ".,", as we use "." as the thousand separator.
Proposed Solution:
Modify the relevant code snippet to include the check for ".,", as follows:
final hasWrongSeparator = newText.contains(',.') || newText.contains('.,');
This change will allow the logic to correctly recognize cases where "." is used as a thousand separator.