title: How to convert a String with decimals to BigDecimal and keep the decimals, in Talend Java?
body: <p>I'm creating a Job in Talend to transform data from a .csv file using some data from a database and then incorporate into another .csv file. During the transformation some calculation is needed to be performed on the values:</p>
  
  <blockquote>
    <p>value1 / value2 * value3 </p>
  </blockquote>
  
  <p>Value1 is taken from the .csv file and is by default a String representing an amount, f.e. </p>
  
  <blockquote>
    <p>"15.25"</p>
  </blockquote>
  
  <p>Values 2 and 3 are taken from database and are BigDecimals with 4 decimal places.
  The result of the calculation must be rounded up to 2 decimal places.</p>
  
  <p><strong>My question is:
  How to convert data from .csv file so that it could be calculated with BigDecimals from database?</strong></p>
  
  <p>If I convert any datatype to BigDecimal it loses the decimals, f.e from String:
      BigDecimal n = new BigDecimal("15.25")
  The result would always be </p>
  
  <blockquote>
    <p>15</p>
  </blockquote>
  
  <p>I'v tried to do it with math context ROUND_UNNECESSARY and setScale also, but this seems not be relevant in this cases.   </p>