-1
$(this).closest('table').find('.total1').val(($(this).closest('table').find('.total').val() * price) / $(this).closest('table').find('.inrvalue').val());

How will i round off the total1 value to 3 decimals?

Sujith Nair
  • 99
  • 12

2 Answers2

1

Number.toFixed(n)

This is native JS, no need for a particular JQuery function.

var value = 10.123456.toFixed(3);
// value = 10.123
nioKi
  • 1,179
  • 8
  • 17
0

You can assign total1 value into different variable and do like this;

   var total1= 4.34597;
   var total1Rounded= Math.round(total1* 1000) / 1000;