Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-1731

JsonWriter.WriteDouble serialize value is invaild on x64

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.4
    • Affects Version/s: 2.2.4
    • Component/s: BSON
    • Environment:
      x64, vs2015 update1-3

      In "MongoDB.Bson\IO\JsonWriter.cs", line 220

      var stringRepresentation = value.ToString("R", NumberFormatInfo.InvariantInfo);

      need replace to
      var stringRepresentation = value.ToString("G17", NumberFormatInfo.InvariantInfo);

      ???

      In some cases, Double values formatted with the "R" standard numeric format string do not successfully round-trip if compiled using the /platform:x64 or /platform:anycpu switches and run on 64-bit systems.

      https://msdn.microsoft.com/en-us/library/dwhawy9k(v=vs.110).aspx#RFormatString

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            Shrimpz Shrimpz [X]
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: