diff --git a/tabulate/__init__.py b/tabulate/__init__.py index 12a2950..c13366d 100644 --- a/tabulate/__init__.py +++ b/tabulate/__init__.py @@ -1652,7 +1652,7 @@ def _wrap_text_to_colwidths( else ( str(cell) if cell == "" or _isnumber(cell) - else str(_type(cell, numparse)(cell)) + else str(_type(cell, numparse=numparse)(cell)) ) ) wrapped = [ diff --git a/test/test_output.py b/test/test_output.py index ea3da87..41d99b8 100644 --- a/test/test_output.py +++ b/test/test_output.py @@ -3292,6 +3292,18 @@ def test_disable_numparse_true(): assert_equal(expected, result) +def test_disable_numparse_maxcolwidths_keeps_thousands_separator(): + "Wrapping must not parse a disabled numeric column such as 100,120" + result = tabulate( + [["100,120"]], + headers=["x"], + tablefmt="plain", + maxcolwidths=[20], + disable_numparse=True, + ) + assert "100,120" in result + + def test_disable_numparse_list(): "Output: Default table output, but with number parsing selectively disabled" table_headers = ["h1", "h2", "h3"]