From 793c271b4b1ab3309eb477d752ba0bfbb71a1c8b Mon Sep 17 00:00:00 2001 From: nietras Date: Sat, 25 Apr 2026 11:45:30 +0200 Subject: [PATCH] Parsing incorrect if number text has thousands separator(s) --- TestcsFastFloat/Basic/TestFloatParser.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/TestcsFastFloat/Basic/TestFloatParser.cs b/TestcsFastFloat/Basic/TestFloatParser.cs index a2517b3..1b1f8ba 100644 --- a/TestcsFastFloat/Basic/TestFloatParser.cs +++ b/TestcsFastFloat/Basic/TestFloatParser.cs @@ -2,6 +2,7 @@ using csFastFloat.Structures; using System; using System.Collections.Generic; +using System.Globalization; using System.Text; using Xunit; @@ -22,6 +23,18 @@ public class TestFloatParser : BaseTestClass { "-infinity", float.NegativeInfinity } }; + [Fact] + unsafe public void FastFloatParser_ThousandSeparator() + { + var culture = CultureInfo.InvariantCulture; + var input = "1,234,567.89"; + fixed (char* p = input) + { + var bcl = float.Parse(input, culture); + var csff = FastFloatParser.ParseFloat(input); + Assert.Equal(bcl, csff); + } + } [Trait("Category", "Smoke Test")] [Theory]