{"id":100,"date":"2025-01-19T15:35:32","date_gmt":"2025-01-19T15:35:32","guid":{"rendered":"https:\/\/noticias.contably.mx\/home\/?page_id=100"},"modified":"2025-01-19T15:35:32","modified_gmt":"2025-01-19T15:35:32","slug":"calcompuesto","status":"publish","type":"page","link":"https:\/\/noticias.contably.mx\/home\/calcompuesto\/","title":{"rendered":"Calcula interes compuesto"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>Calculadora de Inter\u00e9s Compuesto<\/title>\n    <script src=\"https:\/\/cdn.jsdelivr.net\/npm\/chart.js\"><\/script>\n    <style>\n        body {\n            font-family: Arial, sans-serif;\n            margin: 20px;\n        }\n        .container {\n            max-width: 800px;\n            margin: auto;\n        }\n        .formula {\n            background-color: #f0f0f0;\n            padding: 10px;\n            margin-bottom: 20px;\n            border-left: 4px solid #007bff;\n        }\n    <\/style>\n<\/head>\n<body>\n    <div class=\"container\">\n        <h1>Calculadora de Inter\u00e9s Compuesto<\/h1>\n\n        <div class=\"formula\">\n            <strong>F\u00f3rmula del Inter\u00e9s Compuesto:<\/strong> <br>\n            A = P(1 + r\/n)<sup>nt<\/sup> + (C * [((1 + r)<sup>t<\/sup> &#8211; 1) \/ r])\n        <\/div>\n\n        <form id=\"calculator-form\">\n            <label for=\"principal\">Capital Inicial (P):<\/label><br>\n            <input type=\"number\" id=\"principal\" required><br><br>\n\n            <label for=\"rate\">Tasa de Inter\u00e9s Anual (%) (r):<\/label><br>\n            <input type=\"number\" id=\"rate\" step=\"0.01\" required><br><br>\n\n            <label for=\"years\">N\u00famero de A\u00f1os (t):<\/label><br>\n            <input type=\"number\" id=\"years\" required><br><br>\n\n            <label for=\"additional\">Ahorro Anual Adicional (C):<\/label><br>\n            <input type=\"number\" id=\"additional\" required><br><br>\n\n            <button type=\"button\" onclick=\"calculateAndDisplay()\">Calcular<\/button>\n        <\/form>\n\n        <h2>Resultados<\/h2>\n        <p><strong>Inter\u00e9s Compuesto:<\/strong> <span id=\"compound-result\">&#8211;<\/span><\/p>\n        <p><strong>Ahorro sin Invertir:<\/strong> <span id=\"simple-saving\">&#8211;<\/span><\/p>\n        <canvas id=\"results-chart\" width=\"400\" height=\"200\"><\/canvas>\n    <\/div>\n\n    <script>\n        function calculateAndDisplay() {\n            const P = parseFloat(document.getElementById('principal').value);\n            const r = parseFloat(document.getElementById('rate').value) \/ 100;\n            const t = parseInt(document.getElementById('years').value);\n            const C = parseFloat(document.getElementById('additional').value);\n\n            \/\/ C\u00e1lculo del inter\u00e9s compuesto\n            let compoundTotal = P * Math.pow(1 + r, t);\n            let additionalTotal = C * ((Math.pow(1 + r, t) - 1) \/ r);\n            const compoundResult = compoundTotal + additionalTotal;\n\n            \/\/ C\u00e1lculo del ahorro sin invertir\n            const simpleSaving = P + (C * t);\n\n            \/\/ Mostrar resultados\n            document.getElementById('compound-result').textContent = compoundResult.toFixed(2);\n            document.getElementById('simple-saving').textContent = simpleSaving.toFixed(2);\n\n            \/\/ Graficar resultados\n            const ctx = document.getElementById('results-chart').getContext('2d');\n            new Chart(ctx, {\n                type: 'bar',\n                data: {\n                    labels: ['Inter\u00e9s Compuesto', 'Ahorro sin Invertir'],\n                    datasets: [{\n                        label: 'Total (USD)',\n                        data: [compoundResult, simpleSaving],\n                        backgroundColor: ['#007bff', '#ffc107'],\n                        borderColor: ['#0056b3', '#e0a800'],\n                        borderWidth: 1\n                    }]\n                },\n                options: {\n                    responsive: true,\n                    plugins: {\n                        legend: {\n                            display: false\n                        }\n                    },\n                    scales: {\n                        y: {\n                            beginAtZero: true\n                        }\n                    }\n                }\n            });\n        }\n    <\/script>\n<\/body>\n<\/html>\n\n","protected":false},"excerpt":{"rendered":"<p>Calculadora de Inter\u00e9s Compuesto Calculadora de Inter\u00e9s Compuesto F\u00f3rmula del Inter\u00e9s Compuesto: A = P(1 + r\/n)nt + (C * [((1 + r)t &#8211; 1) \/ r]) Capital Inicial (P): Tasa de Inter\u00e9s Anual (%) (r): N\u00famero de A\u00f1os (t): Ahorro Anual Adicional (C): Calcular Resultados Inter\u00e9s Compuesto: &#8211; Ahorro sin Invertir: &#8211;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-100","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/noticias.contably.mx\/home\/wp-json\/wp\/v2\/pages\/100","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/noticias.contably.mx\/home\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/noticias.contably.mx\/home\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/noticias.contably.mx\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/noticias.contably.mx\/home\/wp-json\/wp\/v2\/comments?post=100"}],"version-history":[{"count":3,"href":"https:\/\/noticias.contably.mx\/home\/wp-json\/wp\/v2\/pages\/100\/revisions"}],"predecessor-version":[{"id":104,"href":"https:\/\/noticias.contably.mx\/home\/wp-json\/wp\/v2\/pages\/100\/revisions\/104"}],"wp:attachment":[{"href":"https:\/\/noticias.contably.mx\/home\/wp-json\/wp\/v2\/media?parent=100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}