Diametral pitch is always in inches.
Pd = N/D = number of teeth to inches of pitch diameter
Module pitch is always in millimeters.
Module m = D/N = mm of pitch diameter per tooth
1 Diametral pitch = 25.400 Module.
Example:
A gear with 10 teeth and 1.000 inch pitch diameter:
10 diametral pitch = 10 / 1.000in
The same gear in metric:
2.54 module = 25.4mm / 10
m = 25.4/Pd
Pd = 25.4/m