Just add it to your website using script src to https://faatehsultan.github.io/gpa-calculator-js/gpa-calculator-js.js
Follow the steps below use this library.
- Create an element with #validation_report for reporting invalid input errors.
- Call addSubject() to add subjects again and again.
- Optionally, set the required result precision by modifying resultPrecision variable. The default value is 5.
- After adding all the subjects, you can use either calculateGPA_viaDOM() or calculateGPA_viaValue() to get the result via DOM element #current_gpa_result (you need to create an element with this id) or via JS function return value respectively.
- You can also reset the application by calling resetGPA_app().
This project is licensed under MIT License. You can use this GPA Calculator anywhere in your own projects.