@arunsingh009
Posted
Ok, @PeterScope your design looks cool I also have tried the same challenge but was unable to put that dolor logo and person logo in the input field in my challenge. Now, coming to your problem of the total amount, for total amount logic is very easy. First, calculate the total amount of tip which has to be divided into the number of people then add it to the bill amount and then divide the total amount by a number of people.
For your reference. Suppose Bill amount is 100 and you are selecting 5% tip then the total tip amount will be equal to 5 and suppose 5 people are sharing the amount then,
- total amount = 105.
- total tip amount = 5
- tip/person=5/5=1
- total amount/person = 105/5=21.
I hope this explanation helps I tried my best to make things clear for you.
Marked as helpful
@arunsingh009
Posted
@PeterScope If this explanation is useful, please mark it as helpfulĀ so that I can determine whether I am good at explaining things or not.
@peterkariola
Posted
@arunsingh009 Sorry for not reply yesterday. It is quite helpful, I was just waiting for me to work on it on github and see how it goes
Thanks for your help @arunsingh009, I am really grateful
@arunsingh009
Posted
@PeterScope your welcome buddy and do let me know once you try