How to round decimal to 2 places? : <p>Below, I am using this JS:</p>

<pre><code>        $("input[name='AuthorizedAmount'], input[name='LessLaborToDate']").change(function () {
        var sum = parseFloat($("input[name='AuthorizedAmount']").val()).toFixed(2) - parseFloat($("input[name='LessLaborToDate']").val()).toFixed(2);
        $("input[name='Subtotal'").val(sum).toFixed(2);
    });
</code></pre>

<p>When I subtract AuthorizedAmount from LessLaborToDate, the number occurring for me in the Subtotal box has a lot of floating numbers past the decimal point. Below is the HTML for the boxes:</p>

<pre><code>                                    &lt;div class="box-body"&gt;

                                        &lt;div class="row"&gt;

                                            &lt;div class="col-md-6"&gt;
                                                &lt;div class="form-group"&gt;
                                                    &lt;label&gt;Authorized Amount&lt;/label&gt;
                                                    &lt;div class="input-group"&gt;
                                                        &lt;span class="input-group-addon"&gt;$&lt;/span&gt;
                                                        &lt;input type="number" class="form-control" name="AuthorizedAmount" min="0" max="9999999999.99" step="0.01" required&gt;

                                                    &lt;/div&gt;
                                                &lt;/div&gt;&lt;!-- /.form-group --&gt;
                                            &lt;/div&gt;&lt;!-- /.col --&gt;

                                            &lt;div class="col-md-6"&gt;
                                                &lt;div class="form-group"&gt;
                                                    &lt;label&gt;Less Labor to Date&lt;/label&gt;
                                                    &lt;div class="input-group"&gt;
                                                        &lt;span class="input-group-addon"&gt;$&lt;/span&gt;
                                                        &lt;input type="number" value="0" class="form-control" name="LessLaborToDate" min="0" max="9999999999.99" step="0.01" required&gt;
                                                    &lt;/div&gt;
                                                &lt;/div&gt;&lt;!-- /.form-group --&gt;
                                            &lt;/div&gt;&lt;!-- /.col --&gt;

                                        &lt;/div&gt;&lt;!-- /.row --&gt;

                                        &lt;div class="row"&gt;

                                            &lt;div class="col-md-6"&gt;
                                                &lt;div class="form-group"&gt;
                                                    &lt;label&gt;Subtotal&lt;/label&gt;
                                                    &lt;div class="input-group"&gt;
                                                        &lt;span class="input-group-addon"&gt;$&lt;/span&gt;
                                                        &lt;input type="number" class="form-control" name="Subtotal" placeholder="Authorized Amount minus Less Labor to Date" min="0" max="9999999999.99" step="0.01" readonly&gt;
                                                    &lt;/div&gt;
                                                &lt;/div&gt;&lt;!-- /.form-group --&gt;
                                            &lt;/div&gt;&lt;!-- /.col --&gt;

                                            &lt;div class="col-md-6"&gt;
                                                &lt;div class="form-group"&gt;
                                                &lt;/div&gt;
                                            &lt;/div&gt;&lt;!-- /.col --&gt;

                                        &lt;/div&gt;&lt;!-- /.row --&gt;

                                    &lt;/div&gt;&lt;!-- /.box-body --&gt;
</code></pre>

<p>Am I doing something wrong for it to not show only 2 decimal places?</p>
