0
 "render": function(data, type, row) {
     var html = data.amount + data.interes;
     return html;
  }

This image is not correct because when I display It will become 1005, 10040. The correct addition is 105 and 140 this is want to display.

Teemu
  • 22,918
  • 7
  • 53
  • 106
  • We've to know the values you're calculating with. – Teemu Apr 15 '21 at 09:59
  • Please visit the [help center](https://stackoverflow.com/help), take the [tour](https://stackoverflow.com/tour) to see what and [How to Ask](https://stackoverflow.com/help/how-to-ask). Do some research, search for related topics on SO; if you get stuck, post a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of your attempt, noting input and expected output using the [<>] snippet editor. – kunal panchal Apr 15 '21 at 10:01
  • @Teemu i don't know why display like this 1005, the correct is 105 I've used javascript operator `+` example `data1 + data2` like this. – Makuri David Apr 15 '21 at 10:03
  • Yes, but what values `data1` and `data2` have? – Teemu Apr 15 '21 at 10:04
  • @Teemu `data1 = 100 + data2 = 5' but the result is 1005, the correct result is `105`, what wrong of my code ? – Makuri David Apr 15 '21 at 10:07
  • 1
    Seems you are just concatenating two string values, try converting them to number `parseInt(data.amount) + parseInt(data.interes)`. – Ravikumar Apr 15 '21 at 10:07
  • @MakuriDavid OK, Quentin has found a good post that answers your question. – Teemu Apr 15 '21 at 10:08

0 Answers0