From 0c6f33762a5bcc9d3f00eb2f00945efbe95ff564 Mon Sep 17 00:00:00 2001 From: Redstone1024 <2824517378@qq.com> Date: Tue, 14 Jan 2025 16:55:06 +0800 Subject: [PATCH] fix(strings): fix incorrect treating 'A' as decimal number --- .../Source/Public/Strings/Formatting.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Redcraft.Utility/Source/Public/Strings/Formatting.h b/Redcraft.Utility/Source/Public/Strings/Formatting.h index 3998d6c..29c3330 100644 --- a/Redcraft.Utility/Source/Public/Strings/Formatting.h +++ b/Redcraft.Utility/Source/Public/Strings/Formatting.h @@ -279,7 +279,7 @@ FORCEINLINE constexpr TRangeIterator Format(R2&& Output, R1&& Fmt, Ts&&... A { const uint Digit = FCharTraits::ToDigit(Char); - if (Digit > 10) bIsValid = false; + if (Digit >= 10) bIsValid = false; Index = Index * 10 + Digit; @@ -608,7 +608,7 @@ public: const uint Digit = FCharTraits::ToDigit(Char); - if (Digit > 10) break; + if (Digit >= 10) break; MinFieldWidth = MinFieldWidth * 10 + Digit; } @@ -702,7 +702,7 @@ public: const uint Digit = FCharTraits::ToDigit(Char); - if (Digit > 10) break; + if (Digit >= 10) break; MaxFieldWidth = MaxFieldWidth * 10 + Digit; } @@ -1362,7 +1362,7 @@ public: const uint Digit = FCharTraits::ToDigit(Char); - if (Digit > 10) break; + if (Digit >= 10) break; FieldWidth = FieldWidth * 10 + Digit; } @@ -1465,7 +1465,7 @@ public: const uint Digit = FCharTraits::ToDigit(Char); - if (Digit > 10) break; + if (Digit >= 10) break; IntegralBase = IntegralBase * 10 + Digit; } @@ -2236,7 +2236,7 @@ public: const uint Digit = FCharTraits::ToDigit(Char); - if (Digit > 10) break; + if (Digit >= 10) break; FieldWidth = FieldWidth * 10 + Digit; } @@ -2332,7 +2332,7 @@ public: const uint Digit = FCharTraits::ToDigit(Char); - if (Digit > 10) break; + if (Digit >= 10) break; Precision = Precision * 10 + Digit; }