{"id":20435,"date":"2024-10-09T22:32:51","date_gmt":"2024-10-09T17:02:51","guid":{"rendered":"https:\/\/bigbreakingwire.in\/?post_type=tools&p=20435"},"modified":"2024-10-09T22:33:13","modified_gmt":"2024-10-09T17:03:13","slug":"gratuity-calculator","status":"publish","type":"tools","link":"https:\/\/bigbreakingwire.in\/tools\/gratuity-calculator\/","title":{"rendered":"Gratuity Calculator"},"content":{"rendered":"\n\n\n\n \n \n Gratuity Calculator<\/title>\n <style>\n body {\n font-family: Arial, sans-serif;\n padding: 20px;\n }\n\n .calculator-container {\n max-width: 600px;\n margin: auto;\n background-color: #fff;\n padding: 20px;\n border-radius: 10px;\n box-shadow: 0 2px 10px rgba(0,0,0,0.1);\n }\n\n .calculator-container h1 {\n text-align: center;\n color: #BA2026;\n margin-bottom: 20px;\n }\n\n .input-container {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 20px;\n }\n\n .input-container input[type=\"number\"] {\n width: 70%;\n padding: 10px;\n border: 1px solid #ccc;\n border-radius: 5px;\n text-align: right;\n }\n\n .input-container label {\n width: 25%;\n margin-right: 10px;\n }\n\n .result-section {\n margin-top: 20px;\n text-align: center;\n }\n\n .result-box {\n padding: 20px;\n background-color: #f0f0f0;\n border-radius: 10px;\n }\n\n .result-box h3 {\n margin-bottom: 15px;\n color: #BA2026;\n }\n\n button {\n width: 100%;\n padding: 15px;\n background-color: #BA2026;\n color: white;\n border: none;\n border-radius: 5px;\n font-size: 18px;\n cursor: pointer;\n margin-top: 20px;\n }\n\n button:hover {\n background-color: #a6201f;\n }\n <\/style>\n<\/head>\n<body>\n\n <div class=\"calculator-container\">\n <h1>Gratuity Calculator<\/h1>\n\n <!-- Basic Salary Input -->\n <div class=\"input-container\">\n <label for=\"basicSalary\">Basic Salary (\u20b9)<\/label>\n <input type=\"number\" id=\"basicSalary\" value=\"0\" placeholder=\"Enter Basic Salary\">\n <\/div>\n\n <!-- Years of Service Input (min 5) -->\n <div class=\"input-container\">\n <label for=\"yearsOfService\">Years of Service<\/label>\n <input type=\"number\" id=\"yearsOfService\" value=\"5\" min=\"5\" placeholder=\"Enter Years of Service (min 5)\">\n <\/div>\n\n <!-- Gratuity Calculation Button -->\n <button onclick=\"calculateGratuity()\">Calculate Gratuity<\/button>\n\n <div class=\"result-section\">\n <div class=\"result-box\">\n <h3>Gratuity Amount<\/h3>\n <p id=\"gratuityResult\">\u20b90.00<\/p>\n <\/div>\n <\/div>\n <\/div>\n\n <script>\n function calculateGratuity() {\n const basicSalary = parseFloat(document.getElementById('basicSalary').value);\n const yearsOfService = parseFloat(document.getElementById('yearsOfService').value);\n\n \/\/ Ensure Years of Service is 5 or greater\n if (yearsOfService < 5 || basicSalary <= 0) {\n document.getElementById('gratuityResult').innerText = \"Years of service must be at least 5.\";\n return;\n }\n\n \/\/ Gratuity formula: (Basic Salary * 15 \/ 26) * Years of Service\n const gratuity = (basicSalary * 15 \/ 26) * yearsOfService;\n document.getElementById('gratuityResult').innerText = `\u20b9${gratuity.toFixed(2)}`;\n }\n <\/script>\n\n<\/body>\n<\/html>\n\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Gratuity Calculator Gratuity Calculator Basic Salary (\u20b9) Years of Service Calculate Gratuity Gratuity Amount \u20b90.00<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"tools":[],"class_list":["post-20435","tools","type-tools","status-publish","format-standard","hentry","entry","rows"],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":false,"_links":{"self":[{"href":"https:\/\/bigbreakingwire.in\/wp-json\/wp\/v2\/tools\/20435"}],"collection":[{"href":"https:\/\/bigbreakingwire.in\/wp-json\/wp\/v2\/tools"}],"about":[{"href":"https:\/\/bigbreakingwire.in\/wp-json\/wp\/v2\/types\/tools"}],"author":[{"embeddable":true,"href":"https:\/\/bigbreakingwire.in\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bigbreakingwire.in\/wp-json\/wp\/v2\/comments?post=20435"}],"version-history":[{"count":0,"href":"https:\/\/bigbreakingwire.in\/wp-json\/wp\/v2\/tools\/20435\/revisions"}],"wp:attachment":[{"href":"https:\/\/bigbreakingwire.in\/wp-json\/wp\/v2\/media?parent=20435"}],"wp:term":[{"taxonomy":"tools","embeddable":true,"href":"https:\/\/bigbreakingwire.in\/wp-json\/wp\/v2\/tools?post=20435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}