title: gson.toJson(object) BigDecimal Precision Lost
body: <p>When I converting Object to Json, I have a problem with BigDecimal Precision loosing.<br>
  Let Say I have Pojo Class with,</p>
  
  <pre><code>public class DummyPojo {
      private BigDecimal amount;
      private String id;
      public String getId() {
          return id;
      }
      public void setId(String id) {
          this.id = id;
      }
      public BigDecimal getAmount() {
          return amount;
      }
      public void setAmount(BigDecimal amount) {
          this.amount = amount;
      }
  } 
  </code></pre>
  
  <p>Now I am setting value to Pojo then converting to JSON</p>
  
  <pre><code>public static void main(String[] args) {
          BigDecimal big = new BigDecimal("1000.0005");
          JSONObject resultJson = new JSONObject();
          DummyPojo summary = new DummyPojo();
          summary.setId("A001");
          summary.setAmount(big);
  
          resultJson.put("summary",new Gson().toJson(summary));
          String result = resultJson.toString();
          System.out.println(result);
      }
  </code></pre>
  
  <p><strong>1st Test - Correct Output</strong></p>
  
  <pre><code>Output -&gt; {"summary":{"amount":1000.0005,"id":"A001"}}
  </code></pre>
  
  <p><strong>2nd Test - Wrong Output (Lost BigDecimal Precision)</strong> </p>
  
  <pre><code>BigDecimal big = new BigDecimal("1234567.5555"); //Changed the value
  Output -&gt; {"summary":{"amount":1234567.5,"id":"A001"}}
  </code></pre>
  
  <p><strong>3rd Test - Wrong Output (Lost BigDecimal Precision)</strong> </p>
  
  <pre><code>BigDecimal big = new BigDecimal("100000.0005"); //Changed the value
  Output -&gt; {"summary":{"amount":100000,"id":"A001"}}
  </code></pre>
  
  <p>Amazing that whenever BigDecimal value is higher length then it truncate decimal place as well. 
  What is the problem with json coversion. Would you please provide me the solution?  </p>