• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

141
Views
Quiero arreglar los lugares decimales del valor del cuadro de texto.

La siguiente función también calcula la suma del tiempo de ejecución. txtRate es el cuadro de texto que se procesará para la corrección decimal.

 $(function() { $("[id*=txtRate]").val("0"); }); $("body").on("change", "[id*=txtRate]", function() { var rate = parseFloat($.trim($(this).val())); if (isNaN(rate)) { rate = 0; } //Update the Rate TextBox. $(this).val(rate); //Calculate and update Row Total. var row = $(this).closest("tr"); $("[id*=lblTotal]", row).html(parseFloat($(".quantity", row).html()) * parseFloat($(this).val())); //Calculate and update Grand Total. var grandTotal = 0; $("[id*=lblTotal]").each(function() { grandTotal = grandTotal + parseFloat($(this).html()); }); $("[id*=lblGrandTotal]").html(grandTotal.toString()); });
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>

about 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error