Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tip Calculator completed code;Day 2 Completed code; The conversion for rounding off to 2 decimal places not working #7

Open
muditshamz opened this issue Nov 9, 2020 · 2 comments

Comments

@muditshamz
Copy link

Below code is not working

final_amount = round(bill * (1 + tip / 100) / people, 2)
print(f"Each person should pay: ${final_amount}")

final_amount = round(bill * (1 + tip / 100) / people, 2)
final_contribution_eachHead = "{:.2f}".format(final_amount)
print("Every person will pay:$",final_contribution_eachHead)

Above code can further be optimised but looking at the level of exercise this detailed code is omitted of optimisation.

@ThariqGIT
Copy link

what is the error you are getting

@ThariqGIT
Copy link

/////////////////////works fine for me/////////
Welcome to the tip calculator!
What was the total bill? $12.78
How much tip would you like to give? 10, 12, or 15? 10
How many people to split the bill?3
Each person should pay: $4.69

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants