title: System.Text.Json serializes a value 1.0 of type double to an value 1 of type int by default
body: <p>I am in the process of upgrading to ASP.NET Core 3.1, after switching to System.Text.Json noticed strange result variation in floating point values. Upon investigation, I realized System.Text.Json converts a double value to int. For example, consider a simple contract:</p>
  
  <pre><code>public class RowVector
  {
      [JsonPropertyName("x")]
      public double X { get; set; }
  
      [JsonPropertyName("y")]
      public double Y { get; set; }
  
      [JsonPropertyName("z")]
      public double Z { get; set; }
  }
  
  var rowVector = new RowVector { X = 1.0, Y = 213.9, Z = 112.0 };
  var serializedData = JsonSerializer.Serialize(rowVector);
  
  Serialized-Data output with System.Text.Json :{"x":1,"y":213.9,"z":112}
  </code></pre>
  
  <p>Here x and z are int values, whereas in Newtonsoft.Json, </p>
  
  <pre><code>Serialized-Data output with Newtonsoft.Json :{"X":1.0,"Y":213.9,"Z":112.0}
  </code></pre>
  
  <p>Here x and z are retained as double.</p>
  
  <p>So with system.text.json, upon deserialization these values are int and this leads to variation in our processing calculation, any idea why this is implemented in such a way in System.Text.Json?</p>