@tatasadi
Posted
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 helpful
@Frame993
Posted
@tatasadi thanks for the support, I really love this journey Im getting into, the changes will be ASAP