public int CompareTo(ISupportUnitOfMeasure other) { if (other == null) { return 1; } if (ReferenceEquals(this, other)) { return 0; } int dimensionTypeComparison = _dimensionType.CompareTo(other.DimensionType); if (dimensionTypeComparison != 0) { return dimensionTypeComparison; } double otherValueInBase = other.ValueInBaseUnits; return AreClose(_baseUnitsValue, otherValueInBase) ? 0 : _baseUnitsValue.CompareTo(otherValueInBase); }
public void Fix(ISupportUnitOfMeasure dimension) { dimension.Units = _unitPreferences[dimension.Units.DimensionType]; }
public bool Equals(ISupportUnitOfMeasure other) { return CompareTo(other) == 0; }