A fast, mobile-friendly tip calculator that splits bills fairly between any number of people.
[https://ifeanyi234.github.io/tip-calculator/]
- Preset tip buttons (5%, 10%, 15%, 20%)
- Calculates tip amount, total bill, and per-person share
- Handles decimal bill amounts (e.g. ₦1500.50)
- Validates empty inputs and zero/negative values
- Resets form after each calculation
HTML, CSS, JavaScript (no frameworks)
- Radio button pattern using classList for mutually exclusive selection
- Returning multiple calculated values from a single function using an object
- parseFloat vs parseInt and when each is appropriate
- Resetting form state cleanly after submission
Because this is a Vanilla JavaScript project without build tools, setup is extremely simple:
- Clone the repository:
Open index.html directly in any modern web browser.
git clone https://github.com/ifeanyi234/Tip-calculator.git cd Tip-calculator
- No custom tip percentage input beyond the presets
- Currency formatting doesn't add thousand separators (e.g. ₦10,000)
- Add a custom tip % input field
- Format currency with commas (Intl.NumberFormat)
- Add a reset button so user can start over without submitting



