Measurement units, including imperial and SI units

View versions (1)

Interface

#include <codecogs/units/convert/pressure.h>

using namespace Units::Convert;

Overview

The standard measurement units are:

Unit names Alternate names / spellings Abbreviation Enumeration Code Conversion Rate (relative to first unit)
Pressure
Pascals Pascal Pa unit_Pa 1
Atmospheres Atmosphere atm unit_atm 9.87E-06
Bars Bar bar unit_bar 1.00E-05
Cm of Mercury Cm Mercury cmHg unit_cmHg 0.000750062
Dynes/Centimeter2 Dynes/Centimetre2 dyn/sq cm unit_dyn-cm2 10
Inches of Mercury Inch of Mercury in Hg unit_inHg 0.0002953
Pounds/Foot2 Pounds/Feet2 lb/sq ft unit_lb-ft2 0.020885434
Pounds/Inch2 Pound/Inches2 PSI unit_PSI 0.000145038
Tons/Foot2 Tonnes/Feet2 T/sq ft unit_T-ft2 1.04E-05
Tons/Inch2 Tonnes/Inch2 T/sq in unit_T-in2 7.25E-08
Torrs Torr unit_Torr 0.007500617
Kilograms/Meter2 Kilograms/Metre2 kg/sq m unit_kg-m2 0.101971621
GPL Licence — free for non commercial use. See Licence details.

FUNCTION

pressure

Converts a pressure from one unit to another.

Example 1

#include <iostream>
#include <codecogs/units/convert/pressure.h>

using namespace Units::Convert;
int main()
{
  std::cout << "pressure(23.5,unit_Pa, unit_T_ft2)=" << pressure(23.5,unit_Pa, unit_T_ft2);

  return 0;
}

Output:

pressure(23.5,unit_Pa, unit_T_ft2)= 0.00024540385232

Parameters

number
the value in from_unit 's to convert
from_unit
an enumerated value of the initial pressure type
to_unit
an emuerated value of the output pressure type

Returns

the value in the converted unit.