Any length of pants, as long as they’re at least ankle-length, are good when we speak of formal-wear. However, they shouldn’t be too long hiding your footwear or touching the floor. This gives the impression that the pants are not tailored to you.