Click or drag to resize

ConversionRatioCombineThroughBase Method

Combines two ConversionRatio instances, which are conversion ratios against a single base unit of measure.

Namespace:  Aloe.EnterpriseOne.Model.Core.Metrics
Assembly:  Aloe.EnterpriseOne.Model (in Aloe.EnterpriseOne.Model.dll) Version: 20.1.3.5
Syntax
public static ConversionRatio CombineThroughBase(
	ConversionRatio sourceToBase,
	ConversionRatio destinationToBase
)

Parameters

sourceToBase
Type: Aloe.EnterpriseOne.Model.Core.MetricsConversionRatio
The ConversionRatio from the source unit of measure to the base unit of measure.
destinationToBase
Type: Aloe.EnterpriseOne.Model.Core.MetricsConversionRatio
The ConversionRatio from the destination unit of measure to the base unit of measure.

Return Value

Type: ConversionRatio
The combined ConversionRatio.
Remarks

CombineThroughBase(ConversionRatio, ConversionRatio) combines two ConversionRatio instances in a single instance. The two instances should represent respectively the conversion ratio from the source and the destination unit of measure to the base unit of measure.

The method is usefull to combine two conversions in one, without loosing precision.

Examples
//pieces is used as the base measurement unit ConversionRatio boxesToPieces = new ConversionRatio(12, 1); //12 pieces in a box ConversionRatio kilogramsToPieces = new ConversionRatio(1, 2); //Each piece is 2 kg. //combine the two conversion ratios, using the pieces as the base unit of measure ConversionRatio boxesToKilograms = ConversionRatio.CombineThroughBase(boxesToPieces, kilogramsToPieces);
See Also