Skip to content

Commit 71fe0da

Browse files
committed
TryGetDecimal before falling back to string value
1 parent 24e7a00 commit 71fe0da

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

ServiceStack.Text/src/ServiceStack.Text/SystemJsonUtils.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public class SystemJsonUtils
2222
return longValue;
2323
if (element.TryGetDouble(out double doubleValue))
2424
return doubleValue;
25+
if (element.TryGetDecimal(out decimal decimalValue))
26+
return decimalValue;
2527
return element.GetRawText(); // Fallback
2628
case JsonValueKind.True:
2729
return true;

0 commit comments

Comments
 (0)