title: Karate API : Round a number to 2 decimal point in Json payload Karate API
body: <p>I'm trying to pass a value from a key which is in e.g . &quot;29.00&quot;.  The request I'm passing this value to doesn't accept double quotations around the value.  It's accepting 2 decimal points only and a number. e.g 29.00</p>
  <p>The issue is when I use <strong>parseInt(amount)</strong> or <strong>parseFloat(amount)</strong> its drops the last zero.  So the value becomes 29.0 which the api is not accepting.</p>
  <p>I just need the value to be in 2 decimal points so the trailing 0 is not dropped.</p>
  <p>I have used JS functions like function(test) { return parseInt(amount).toFixed(2)} but it is not working.</p>
  <p>A sample of code I have used:</p>
  <ul>
  <li><p>def reqJson = read ('Json/PaynowPayload.json')</p>
  </li>
  <li><p>def amount = SearchResults.ratePlans[0].rooms[0].totalCost.amount</p>
  </li>
  <li><p>def Newamount = parseInt(amount).toFixed(2)</p>
  </li>
  <li><p>set reqJson.payment.amount.minorUnits = Newamount</p>
  </li>
  </ul>
  <p>Any help would be appreciated</p>