I guess what you need is water vapour pressure - that is one way of expressing humidity as the partial pressure of water vapour - in
hPa (they are equal).
According to World Meteorological Organization (WMO No.8 Guide to Instruments and Methods of Observation, Vol 1 Measurement of Meteorological Variables, ANNEX 4.B. FORMULAE FOR THE COMPUTATION OF MEASURES OF HUMIDITY), saturation vapour pressure -
ews(t) - in hPa may be derived by the following formula, where
t is temperature in degrees Celsius:
ews(t) = 6.112 exp [17.62 t/(243.12 + t)]
in hPa and degrees C, for liquid pure water (–45 °C to 60 °C)
This is the saturation water vapour pressure - a kind of "maximum" water vapour that can normally exist at a certain temperature
To know what the actual water vapour pressure -
ew(t) - is, you must multiply it by the relative humidity (Rh) (and divide by 100 if
Rh is in percentage):
ew(t) = ews(t) * Rh(%) / 100
ew(t) = 6.112 exp [17.62 t/(243.12 + t)] * Rh(%) / 100
This is your "humidity" in mb, if you use Celsius for t.