ConversionRule

The ConversionRule struct represents a unit conversion rule from base unit to second unit within the specified family. Note that in UnitConvertor class each family can be represented with the single base unit. In other words you can't have two unit conversion rules with the same family but different base units

Constructors

this
this()
Undocumented in source.
this
this(string family, string baseUnit, string unit, LinearFunction convertFunction)

Constructs a rule

Members

Variables

baseUnit
string baseUnit;

Base unit for this family

convertFunction
LinearFunction convertFunction;

Linear function to perform conversion from base unit to unit

family
string family;

Family name for this pair of units, like length, speed

unit
string unit;

Unit to convert to

Meta