title: ConvertString to Big Decimal in JAVA
body: <p>I am trying to store a String into a column with datatype Big Decimal.</p>
  
  <pre><code>String a = transaction.getBeneAmt();
  log.info(a);
  tran.setTransAmt(new BigDecimal(transaction.getBeneAmt()));
  tranRepository.saveAndFlush(trangloTran); //save into database
  </code></pre>
  
  <p>But I get</p>
  
  <pre><code>2017-07-05 18:04:19 [http-nio-8080-exec-1] INFO  ApiController - IDR 3,000,000.00
  2017-07-05 18:04:19 [http-nio-8080-exec-1] ERROR o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NumberFormatException] with root cause
  java.lang.NumberFormatException: null
      at java.math.BigDecimal.&lt;init&gt;(BigDecimal.java:494)
      at java.math.BigDecimal.&lt;init&gt;(BigDecimal.java:383)
      at java.math.BigDecimal.&lt;init&gt;(BigDecimal.java:806)
  </code></pre>