{"id":813,"date":"2024-06-10T06:32:51","date_gmt":"2024-06-10T06:32:51","guid":{"rendered":"https:\/\/www.kkmfi.com\/?page_id=813"},"modified":"2024-06-10T06:40:51","modified_gmt":"2024-06-10T06:40:51","slug":"calculate","status":"publish","type":"page","link":"https:\/\/www.kcmfi.com.kh\/km\/calculate\/","title":{"rendered":"Calculate"},"content":{"rendered":"<div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 fusion-flex-container has-pattern-background has-mask-background nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1248px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-0 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\">  <div class=\"container\">\n        <h1>Loan Calculator<\/h1>\n        <form id=\"loan-form\" action=\"\">\n            <div class=\"form-group\">\n                <label for=\"amount\">Loan Amount:<\/label>\n                <input type=\"number\" id=\"amount\" name=\"amount\" required>\n            <\/div>\n            <div class=\"form-group\">\n                <label for=\"interest\">Annual Interest Rate (%):<\/label>\n                <input type=\"number\" id=\"interest\" name=\"interest\" required>\n            <\/div>\n            <div class=\"form-group\">\n                <label for=\"months\">Number of Months (#):<\/label>\n                <input type=\"number\" id=\"months\" name=\"months\" required>\n            <\/div>\n            <button type=\"button\" onclick=\"calculateLoan()\">Calculate<\/button>\n        <input type=\"hidden\" name=\"trp-form-language\" value=\"km\"\/><\/form>\n        <div id=\"results\">\n            <h2>Results:<\/h2>\n            <p id=\"monthly-payment\"><\/p>\n            <p id=\"total-payment\"><\/p>\n            <p id=\"total-interest\"><\/p>\n        <\/div>\n    <\/div><script>\nfunction calculateLoan() {\n  const amount = parseFloat(document.getElementById(\"amount\").value);\n  const interest = parseFloat(document.getElementById(\"interest\").value) \/ 100 \/ 12;\n  const months = parseFloat(document.getElementById(\"months\").value);\n\n  const monthlyPayment = (amount * interest + amount) \/ months;\n  const totalPayment = monthlyPayment * months;\n  const totalInterest = totalPayment - amount;\n\n  document.getElementById(\"monthly-payment\").textContent = `Monthly Payment: $${monthlyPayment.toFixed(2)}`;\n  document.getElementById(\"total-payment\").textContent = `Total Payment: $${totalPayment.toFixed(2)}`;\n  document.getElementById(\"total-interest\").textContent = `Total Interest: $${totalInterest.toFixed(2)}`;\n}\n<\/script><\/div><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"100-width.php","meta":{"footnotes":""},"class_list":["post-813","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.kcmfi.com.kh\/km\/wp-json\/wp\/v2\/pages\/813","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kcmfi.com.kh\/km\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.kcmfi.com.kh\/km\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.kcmfi.com.kh\/km\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kcmfi.com.kh\/km\/wp-json\/wp\/v2\/comments?post=813"}],"version-history":[{"count":5,"href":"https:\/\/www.kcmfi.com.kh\/km\/wp-json\/wp\/v2\/pages\/813\/revisions"}],"predecessor-version":[{"id":830,"href":"https:\/\/www.kcmfi.com.kh\/km\/wp-json\/wp\/v2\/pages\/813\/revisions\/830"}],"wp:attachment":[{"href":"https:\/\/www.kcmfi.com.kh\/km\/wp-json\/wp\/v2\/media?parent=813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}