You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hex float "X" format doesn't round-trip in built-in cultures with directional marks in their sign strings #135039
In .NET 11, double/float/Half formatted with the "X"/"x" format cannot be parsed back with NumberStyles.HexFloat using the same culture when the culture's PositiveSign/NegativeSign is not plain "+"/"-" (for example he-IL, ar-*, fa-IR, ur-PK). The formatter always writes the exponent sign as ASCII +/-, but the parser only accepts the culture's PositiveSign/NegativeSign there.
double.Parse with ar-AE throws FormatException: The input string '0X1.921FB54442D18P+1' was not in a correct format.
Regression?
No, hex floating-point formatting and parsing are new in .NET 11.
Known Workarounds
Use CultureInfo.InvariantCulture for both formatting and parsing.
Configuration
.NET 11.0.0-rc.1.26425.128, linux-x64
Other information
This came up briefly in the Add support for floating-point hex formatting and parsing #124139 review (thread) in the context of custom NumberFormatInfo instances; it also affects built-in cultures, since several CLDR cultures prefix their sign strings with directional marks (e.g. ar-AE PositiveSign is "\u200E+").
Activity
dotnet-policy-service commentedon Oct 1, 2026
Tagging subscribers to this area: @dotnet/area-system-globalization
See info in area-owners.md if you want to be subscribed.
dotnet-policy-service commentedon Oct 1, 2026
Tagging subscribers to this area: @dotnet/area-system-numerics
See info in area-owners.md if you want to be subscribed.
Fix hexadecimal float sign round-tripping (dotnet#135132)
[release/11.0] Fix hexadecimal float sign round-tripping (#135282)