Site Tools


car

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
car [2026/04/04 22:54] admincar [2026/04/04 23:11] (current) – [Table] admin
Line 1: Line 1:
-====== Loan Calculator ====== +Loan Amount ($          | 35000                                                                  | 
- +| Annual Interest Rate (% 2.9                                                                    | 
-<form> +| Duration (Years         | 5                                                                      | 
-fieldset "Loan Details" +| **Monthly Payment**       | ~~=round((r1c1/1200 * r0c1) / (1 - (1 + r1c1/1200)**(-r2c1*12)), 2)~~  | 
-  number "Amount" "10000" >0 +| **Total Interest Paid**   | ~~=round((r3c1 * r2c1 * 12) - r0c1, 2)~~                               | 
-  number "Rate" "5" >0 +| **Total Cost**            | ~~=round(r0c1 + r4c1, 2)~~                                             |
-  number "Years" "5" >0 +
-  static "display" " " +
-submit "Calculate" +
-</form> +
- +
-<js> +
-document.addEventListener("DOMContentLoaded", function() { +
-    var form = document.querySelector(".bureaucracy__form")+
-    if (!form) return; +
- +
-    // Find the button specifically +
-    var btn = form.querySelector("button[type='submit']"); +
-     +
-    if (btn) { +
-        btn.onclick = function(e) { +
-            // 1. STOP the form from submitting and disappearing +
-            e.preventDefault(); +
-            e.stopPropagation(); +
- +
-            // 2. Get the input values +
-            var inputs = form.querySelectorAll('input.edit'); +
-            var p parseFloat(inputs[0].value);  +
-            var r_annual = parseFloat(inputs[1].value);  +
-            var n_years = parseFloat(inputs[2].value);  +
- +
-            // 3. Math and Display +
-            if (p > 0 && r_annual > 0 && n_years > 0+
-                var r = r_annual 100 / 12; +
-                var n = n_years * 12; +
-                var x = Math.pow(1 + r, n)+
-                var m = (p x) / (1); +
-                 +
-                var totalPaid = m n; +
-                var totalInterest = totalPaid - p; +
-                 +
-                var display = form.querySelector(".bureaucracy__static")+
-                display.innerHTML = ` +
-                    <div style="margin-top: 20px; padding: 15px; background: #eef; border: 2px solid #2b73b7; border-radius: 5px;"> +
-                        <h3 style="margin:0 0 10px 0;">Loan Summary</h3> +
-                        <strong>Monthly Payment:</strong> $${m.toFixed(2)}<br> +
-                        <strong>Total Interest:</strong> $${totalInterest.toFixed(2)}<br> +
-                        <strong>Total Cost:</strong> $${totalPaid.toFixed(2)+
-                    </div> +
-                `; +
-            } else { +
-                alert("Please enter values greater than zero."); +
-            } +
-            return false; +
-        }; +
-    } +
-}); +
-</js> +
car.1775343286.txt.gz · Last modified: by admin