Amount Class

Represents an amount of a Unit.

Definition

Namespace: DevCase.Core.Math.Science
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[SerializableAttribute]
public sealed class Amount : ICloneable, 
	IComparable, IComparable<Amount>, IConvertible, IEquatable<Amount>, 
	IFormattable
Inheritance
Object    Amount
Implements
ICloneable, IComparable, IComparableAmount, IConvertible, IEquatableAmount, IFormattable

Example

This is a code example.
C#
No code example is currently available or this language may not be supported.

Constructors

Amount Initializes a new instance of the Amount class.

Properties

EqualityPrecision Gets or sets a value indicating the decimal precision to which two amounts are considered equal.
Unit Gets the Unit of this amount.
Value Gets the value of this amount.

Methods

Add Adds this Amount with the specified Amount (= this + amount).
Clone Returns a clone of this object.
ConvertedTo(Unit) Returns an Amount converted to the specified Unit.
ConvertedTo(Unit, Int32) Returns an Amount converted to the specified Unit and rounded up to the given decimal precision.
DivideBy(Amount) Divides this Amount by the specified Amount (= this / amount).
DivideBy(Double) Divides this Amount by the specified value (= this / value).
Equals(Amount) Determines whether the specified Amount is equal to the current one.
Equals(Object) Determines whether the specified Object is equal to this instance.
(Overrides ObjectEquals(Object))
GetHashCode Returns a hash code for this instance.
(Overrides ObjectGetHashCode)
GetType Gets the Type of the current instance.
(Inherited from Object)
Inverse Returns 1 over this Amount (= 1 / this).
Multiply(Amount) Multiplies this Amount with the specified Amount (= this * amount).
Multiply(Double) Multiply this Amount with the specified value (= this * value).
Negate Negates this Amount (= -this).
Power Raises this Amount to the specified power.
ToString Returns a String that represents this Amount.
(Overrides ObjectToString)
ToString(Amount) Returns a String that represents an Amount.
ToString(IFormatProvider) Returns a String that represents this Amount.
ToString(String) Returns a String that represents this Amount.
ToString(Amount, IFormatProvider) Returns a String that represents an Amount.
ToString(Amount, String) Returns a String that represents an Amount.
ToString(String, IFormatProvider) Returns a String that represents this Amount.
ToString(Amount, String, IFormatProvider) Returns a String that represents an Amount.
Zero Zeroes the specified Unit.

Operators

Addition(Amount, Amount) Sums two Amount of compatible units.
Division(Amount, Amount) Divides two Amount.
Division(Amount, Double) Divides an Amount by a Double value.
Division(Double, Amount) Divides a Double value by an Amount.
Equality(Amount, Amount) Compares two Amount.
(Amount to NullableDouble) Casts an Amount to a double.
GreaterThan(Amount, Amount) Compares two Amount of compatible units.
GreaterThanOrEqual(Amount, Amount) Compares two Amount of compatible units.
Inequality(Amount, Amount) Compares two Amount.
LessThan(Amount, Amount) Compares two Amount of compatible units.
LessThanOrEqual(Amount, Amount) Compares two Amount of compatible units.
Multiply(Amount, Amount) Multiplies two Amount.
Multiply(Amount, Double) Multiplies an Amount with a Double value.
Multiply(Double, Amount) Multiplies a Double value with an Amount.
Subtraction(Amount, Amount) Substracts two Amount of compatible units.
UnaryNegation(Amount) Substracts an Amount.
UnaryPlus(Amount) Sums an Amount.

Extension Methods

CanConvertTo Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions)
CanConvertToT Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions)
ConvertToT Converts an object to the specified target type.

If the conversion fails, an exception is thrown.
(Defined by ObjectExtensions)

ConvertToT Converts an object to the specified target type.

If the conversion fails, returns the specified default value.
(Defined by ObjectExtensions)

IsDisposable Determines whether the specified object is a disposable type (i.e., it implements IDisposable interface).
(Defined by ObjectExtensions)
Speak Speaks the string representation of the source object by using the operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions)
Speak Speaks the string representation of the source object by using the operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions)
ThrowIfNullTException Throws the specified exception if the source object is null.
(Defined by ObjectExtensions)

See Also