Skip to content

Conversation

@filzrev
Copy link
Contributor

@filzrev filzrev commented Oct 16, 2024

This PR intended to fix #991.

What's changed in this PR

  • Replace formatter.FormatNumber(object value); call to ToString("G", CultureInfo.InvariantCulture).
    • It's required to serialize special symbols (Nan/PositiveInfinite/NegativeInfinite) to JSON compatible string representation.
    • Additionally explicitly specify format (G) to align YAML serialized value
  • Remove NumericRegex checks. Instead add IsNaN/IsInfinity checks
  • Add unit test code (SerializationOfNumericsAsJsonRountTrip)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Serialized JSON data of some floating point values (Infinite and NaN and with exponential) contains unexpected result

2 participants