Consider a surface S, like the one shown below. Ampère's Law for steady currents and fields states that the integral of B*dl around a closed path C that surrounds the surface is related to the net current that passes through the surface S by
∫ B*dl = μ0*(±I1 ± I2 ± …)
The sign associated with each current is determined by an application of the right-hand rule. When the fingers of the right hand are curled in the direction of the integration around the closed path C the thumb of the right hand will point in the direction of positive current. Using this rule, I1 in the figure below will have a positive sign and I2 will have a negative sign when one constructs the sum of currents on the right-hand side of Ampère's Law.
Ampère's Law is often used to calculate expressions for magnetic fields in cases of high symmetry like finding the magnetic field due to a long, straight current carrying wire.