Click or drag to resize

Quantity Methods

The Quantity type exposes the following members.

Methods
  NameDescription
Public methodStatic memberAdd
Returns the sum of the specified quantities. The quantities must have the same Unit.
Public methodStatic memberAreCompatible
Returns true if the two quantities are compatible (e.g. have the same unit).
Public methodStatic memberCompare
Compares the quantities. The quantities must have the same unit.
Public methodCompareTo(Object)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
Public methodCompareTo(Quantity)
Compares the current object with another object of the same type.
Public methodStatic memberDivide
Divides the specified quantities. The operation is successful only if both quantities have the same measurement unit.
Public methodEquals(Object)
Determines whether the specified Object, is equal to this instance.
(Overrides ObjectEquals(Object).)
Public methodEquals(Quantity)
Indicates whether the current object is equal to another object of the same type.
Public methodGetHashCode
Returns a hash code for this instance.
(Overrides ObjectGetHashCode.)
Public methodStatic memberMultiply
Multiplies the specified quantity with the specified multiplier.
Public methodStatic memberSubtract
Subtracts the second quantity from the first. The quantities must have the same Unit.
Public methodToString
Returns a String that represents this instance.
(Overrides ObjectToString.)
Public methodToString(CultureInfo)
Returns a String that represents this instance.
Top
Extension Methods
  NameDescription
Public Extension MethodRound
Rounds the quantity as per the precision, supported by the system (0.001).
(Defined by QuantityExtensions.)
Top
See Also