Design comparison
Community feedback
- @tatasadiPosted 10 months ago
Hey there,
Great job on your project! To calculate the total money that each person should give, including their share of the tip, you can use the following approach:
const calculateTotalPerPerson = (billAmount, tipPercentage, numberOfPeople) => { const totalTip = billAmount * (tipPercentage / 100); const totalAmountDue = billAmount + totalTip; return (totalAmountDue / numberOfPeople).toFixed(2); };
This function will help ensure that your calculations are accurate, enhancing the functionality of your app. Keep up the great work, and continue refining your skills with these practical applications!
Marked as helpful0@Frame993Posted 10 months ago@tatasadi thanks for the support, I really love this journey Im getting into, the changes will be ASAP
0 - @MuhammadZariyanAsif123Posted 10 months ago
Hi,
There is an issue in the "Bill" and "Number of People" fields. In your case, the user can enter the negative values inside the fields which is wrong.
Marked as helpful0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord