Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Javascript (https://www.askmehelpdesk.com/forumdisplay.php?f=452)
-   -   Change Math.round to output with 2 decimal places (https://www.askmehelpdesk.com/showthread.php?t=265771)

  • Oct 2, 2008, 11:08 AM
    pell
    change Math.round to output with 2 decimal places
    // Get Input Variables
    for (var p in input_data) {
    input_data[p]=parseFloat($('#'+p).val());
    }
    // Set Constants
    // to be done
    // Calculate Output Variables
    var output_data = {};

    //Set Output Variables
    for (var p in output_data) {
    $('#'+p).html(Math.round(output_data[p]));

    Here are the parts of the script that output a figure with no decimal points. How do I get it to show 2 decimal points? Thanks so much, am NOT a programmer.

  • All times are GMT -7. The time now is 01:24 PM.