>>> _isnumber_with_thousands_separator(".") False >>> _isnumber_with_thousands_separator("1") True >>> _isnumber_with_thousands_separator("1.") True >>> _isnumber_with_thousands_separator(".1") True >>> _isnumber_with_thousands_separator("1000") False >>>
(string)
| 860 | |
| 861 | |
| 862 | def _isnumber_with_thousands_separator(string): |
| 863 | """ |
| 864 | >>> _isnumber_with_thousands_separator(".") |
| 865 | False |
| 866 | >>> _isnumber_with_thousands_separator("1") |
| 867 | True |
| 868 | >>> _isnumber_with_thousands_separator("1.") |
| 869 | True |
| 870 | >>> _isnumber_with_thousands_separator(".1") |
| 871 | True |
| 872 | >>> _isnumber_with_thousands_separator("1000") |
| 873 | False |
| 874 | >>> _isnumber_with_thousands_separator("1,000") |
| 875 | True |
| 876 | >>> _isnumber_with_thousands_separator("1,0000") |
| 877 | False |
| 878 | >>> _isnumber_with_thousands_separator("1,000.1234") |
| 879 | True |
| 880 | >>> _isnumber_with_thousands_separator(b"1,000.1234") |
| 881 | True |
| 882 | >>> _isnumber_with_thousands_separator("+1,000.1234") |
| 883 | True |
| 884 | >>> _isnumber_with_thousands_separator("-1,000.1234") |
| 885 | True |
| 886 | """ |
| 887 | try: |
| 888 | string = string.decode() |
| 889 | except (UnicodeDecodeError, AttributeError): |
| 890 | pass |
| 891 | |
| 892 | return bool(re.match(_float_with_thousands_separators, string)) |
| 893 | |
| 894 | |
| 895 | def _isconvertible(conv, string): |
no outgoing calls
no test coverage detected