[SerializableAttribute]
public sealed class Amount : ICloneable,
IComparable, IComparable<Amount>, IConvertible, IEquatable<Amount>,
IFormattable
<SerializableAttribute>
Public NotInheritable Class Amount
Implements ICloneable, IComparable, IComparable(Of Amount),
IConvertible, IEquatable(Of Amount), IFormattable
Dim instance As Amount
[SerializableAttribute]
public ref class Amount sealed : ICloneable,
IComparable, IComparable<Amount^>, IConvertible, IEquatable<Amount^>,
IFormattable
[<SealedAttribute>]
[<SerializableAttribute>]
type Amount =
class
interface ICloneable
interface IComparable
interface IComparable<Amount>
interface IConvertible
interface IEquatable<Amount>
interface IFormattable
end
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
Dim b1 As New Amount(1, Units.DigitalInformation.Byte)
Dim kb1 As New Amount(1, Units.DigitalInformation.Kilobyte)
Dim mb1 As New Amount(1, Units.DigitalInformation.Megabyte)
Dim sb As New Global.System.Text.StringBuilder()
With sb
.AppendLine(String.Format("{0} bytes is equal to {1} bits", b1.Value, b1.ConvertedTo(Units.DigitalInformation.Bit).Value))
.AppendLine(String.Format("{0} bytes is equal to {1} bytes", b1.Value, b1.ConvertedTo(Units.DigitalInformation.Byte).Value))
.AppendLine(String.Format("{0} kilobytes is equal to {1} bits", kb1.Value, kb1.ConvertedTo(Units.DigitalInformation.Bit).Value))
.AppendLine(String.Format("{0} kilobytes is equal to {1} bytes", kb1.Value, kb1.ConvertedTo(Units.DigitalInformation.Byte).Value))
.AppendLine(String.Format("{0} kilobytes is equal to {1} kilobits", kb1.Value, kb1.ConvertedTo(Units.DigitalInformation.Kilobit).Value))
.AppendLine(String.Format("{0} kilobytes is equal to {1} kilobytes", kb1.Value, kb1.ConvertedTo(Units.DigitalInformation.Kilobyte).Value))
.AppendLine(String.Format("{0} megabytes is equal to {1} bits", mb1.Value, mb1.ConvertedTo(Units.DigitalInformation.Bit).Value))
.AppendLine(String.Format("{0} megabytes is equal to {1} bytes", mb1.Value, mb1.ConvertedTo(Units.DigitalInformation.Byte).Value))
.AppendLine(String.Format("{0} megabytes is equal to {1} kilobits", mb1.Value, mb1.ConvertedTo(Units.DigitalInformation.Kilobit).Value))
.AppendLine(String.Format("{0} megabytes is equal to {1} Kilobytes", mb1.Value, mb1.ConvertedTo(Units.DigitalInformation.Kilobyte).Value))
.AppendLine(String.Format("{0} megabytes is equal to {1} megabits", mb1.Value, mb1.ConvertedTo(Units.DigitalInformation.Megabit).Value))
.AppendLine(String.Format("{0} megabytes is equal to {1} megabytes", mb1.Value, mb1.ConvertedTo(Units.DigitalInformation.Megabyte).Value))
End With
Console.WriteLine(sb.ToString())
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
Amount | Initializes a new instance of the Amount class. |
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. |
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. |
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. |
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) |