pvbrowser manual
Back Content Forward

Unit Conversion

You can set p->convert_units to 0 or 1 (default: 0).

p->convert_units = 1;

Now you may use the function "float unit(PARAM *p, float val, int conversion);". If (p->convert_units == 0) then the original val will be returned.

val = unit(p, val, MM2INCH);

These are the available conversions. You may set p->convert_units depending on your language settings.

enum UNIT_CONVERSION
{
  MM2INCH = 1,
  INCH2MM ,
  CM2FOOT ,
  FOOT2CM ,
  CM2YARD ,
  YARD2CM ,
  KM2MILE ,
  MILE2KM ,
  KM2NAUTICAL_MILE ,
  NAUTICAL_MILE2KM ,
  QMM2SQINCH ,
  SQINCH2QMM ,
  QCM2SQFOOT ,
  SQFOOT2QCM ,
  QM2SQYARD ,
  SQYARD2QM ,
  QM2ACRE ,
  ACRE2QM ,
  QKM2SQMILE ,
  SQMILE2QKM ,
  ML2TEASPOON ,
  TEASPOON2ML ,
  ML2TABLESPOON ,
  TABLESPOON2ML ,
  ML2OUNCE ,
  OUNCE2ML ,
  L2CUP ,
  CUP2L ,
  L2PINT ,
  PINT2L ,
  L2QUART ,
  QUART2L ,
  L2GALLON ,
  GALLON2L ,
  GR2OUNCE ,
  OUNCE2GR ,
  KG2POUND ,
  POUND2KG ,
  T2TON ,
  TON2T ,
  C2FAHRENHEIT ,
  FAHRENHEIT2C
};

Back Content Forward