How much to tip
Customs vary widely. In the US, 15–20% is usual at sit-down restaurants and 18–20% or more for very good service. In the UK and much of Europe, 10–12.5% is common, and many restaurants add a service charge to the bill, so check before adding more. In Japan, tipping is generally not expected. In Pakistan, India and the Gulf, around 10% is a generous tip where no service charge is added.
Tip on the amount before tax if you want to follow the traditional US rule, or on the total if it's simpler.
Splitting fairly
Turn on rounding to make each share a whole amount. The few extra cents go to the tip, so nobody has to dig for coins and the server isn't short.