Ramco Ramco

Ramco Ramco

  • 469
  • 2.8k
  • 392.6k

Summing first digit

Aug 5 2022 1:11 PM

Hi

  With below code it is summing first digit only

<script type="text/javascript">
        $(function () {
            var trs = $("#tbldata tbody").find("tr");
            var sum = 0;
            $(trs).each(function () {
                var tds = $(this).find('td');
                sum = sum + parseFloat($(tds).eq(9).html());
                alert(parseFloat($(tds).eq(9).html()));
            });
            $("#lblSum").html(sum);
        })
    </script>

                        htmlTable.Append("<td style='text-align:right'>" + Convert.ToDecimal(colum.Amount).ToString("0,0", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN")) + "</td>");
 

Thanks


Answers (2)