-
Notifications
You must be signed in to change notification settings - Fork 428
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
parse_decimal is not works correctly when space symbol as grouping #637
Labels
Comments
akx
added a commit
to akx/babel
that referenced
this issue
May 27, 2019
…when not in strict mode Fixes python-babel#637
This is technically by design, but it does make sense to allow a plain space in U+00A0's stead when it is the group separator. |
ronnix
added a commit
to ronnix/babel
that referenced
this issue
Jun 8, 2023
…mbers The French group separator is `"\u202f"` (narrow non-breaking space), but when parsing numbers in the real world, you will most often encounter either a regular space character (`" "`) or a non-breaking space character (`"\xa0"`). The issue was partially adressed earlier in python-babel#637, but only to allow regular spaces instead of non-breaking spaces `"\xa0"` in `parse_decimal`. This commit goes further by changing both `parse_number` and `parse_decimal` to allow any other space character (using the `\s` character class of regular expressions) when the group character is itself a space character, but is not present in the string to parse. Unit tests are included.
ronnix
added a commit
to ronnix/babel
that referenced
this issue
Nov 9, 2023
…mbers The French group separator is `"\u202f"` (narrow non-breaking space), but when parsing numbers in the real world, you will most often encounter either a regular space character (`" "`) or a non-breaking space character (`"\xa0"`). The issue was partially adressed earlier in python-babel#637, but only to allow regular spaces instead of non-breaking spaces `"\xa0"` in `parse_decimal`. This commit goes further by changing both `parse_number` and `parse_decimal` to allow any other space character (using the `\s` character class of regular expressions) when the group character is itself a space character, but is not present in the string to parse. Unit tests are included.
ronnix
added a commit
to ronnix/babel
that referenced
this issue
Apr 16, 2024
…mbers The French group separator is `"\u202f"` (narrow non-breaking space), but when parsing numbers in the real world, you will most often encounter either a regular space character (`" "`) or a non-breaking space character (`"\xa0"`). The issue was partially adressed earlier in python-babel#637, but only to allow regular spaces instead of non-breaking spaces `"\xa0"` in `parse_decimal`. This commit goes further by changing both `parse_number` and `parse_decimal` to allow any other space character (using the `\s` character class of regular expressions) when the group character is itself a space character, but is not present in the string to parse. Unit tests are included.
ronnix
added a commit
to ronnix/babel
that referenced
this issue
Apr 18, 2024
…mbers The French group separator is `"\u202f"` (narrow non-breaking space), but when parsing numbers in the real world, you will most often encounter either a regular space character (`" "`) or a non-breaking space character (`"\xa0"`). The issue was partially adressed earlier in python-babel#637, but only to allow regular spaces instead of non-breaking spaces `"\xa0"` in `parse_decimal`. This commit goes further by changing both `parse_number` and `parse_decimal` to allow any other space character (using the `\s` character class of regular expressions) when the group character is itself a space character, but is not present in the string to parse. Unit tests are included.
akx
pushed a commit
that referenced
this issue
Apr 22, 2024
…mbers (#1007) The French group separator is `"\u202f"` (narrow non-breaking space), but when parsing numbers in the real world, you will most often encounter either a regular space character (`" "`) or a non-breaking space character (`"\xa0"`). The issue was partially adressed earlier in #637, but only to allow regular spaces instead of non-breaking spaces `"\xa0"` in `parse_decimal`. This commit goes further by changing both `parse_number` and `parse_decimal` to allow certain other space characters when the group character is itself a space character, but is not present in the string to parse. Unit tests are included.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is a problem because ' '.replace('\xa0', '.') is not replace space to dot.
The text was updated successfully, but these errors were encountered: