Skip to content

Commit 4d01a90

Browse files
author
Alejandro Panizza Carve
committed
- Fix numeric format in Json Serialization for locales where the comma is the decimal separator. #1153
1 parent 3d3be53 commit 4d01a90

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

dotnet/src/dotnetframework/GxClasses/Domain/GxCollections.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3156,12 +3156,13 @@ public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonS
31563156
{
31573157
if (reader.TokenType == JsonTokenType.Number)
31583158
{
3159+
var numberFmt = CultureInfo.InvariantCulture.NumberFormat;
3160+
31593161
if (reader.TryGetInt32(out int l))
3160-
return l.ToString();
3161-
else if (reader.TryGetDecimal(out decimal d))
3162-
return d.ToString();
3163-
else
3164-
return reader.GetDouble().ToString();
3162+
return l.ToString(numberFmt);
3163+
if (reader.TryGetDecimal(out decimal d))
3164+
return d.ToString(numberFmt);
3165+
return reader.GetDouble().ToString(numberFmt);
31653166
}
31663167
return reader.GetString();
31673168
}

0 commit comments

Comments
 (0)