Gratuity is one of those numbers you only need once — usually on the worst possible day. Knowing the formula in advance is half the battle.