Struct NumeralValue<TLanguageUnits>
A numeral value with an associated unit if there is one.
Some numeral systems have special characters that indicate what the number is for, which is what the
Unit field is for.
Assembly: Romanization.NET.dll
Syntax
public struct NumeralValue<TLanguageUnits> : IEquatable<NumeralValue<TLanguageUnits>>, IComparable<NumeralValue<TLanguageUnits>> where TLanguageUnits : struct
Type Parameters
| Name |
Description |
| TLanguageUnits |
|
Constructors
|
Improve this Doc
View Source
NumeralValue(Decimal, Nullable<TLanguageUnits>)
Declaration
public NumeralValue(decimal value, TLanguageUnits? unit = null)
Parameters
| Type |
Name |
Description |
| System.Decimal |
value |
The value.
|
| System.Nullable<TLanguageUnits> |
unit |
The unit the value is in, if any.
|
Fields
|
Improve this Doc
View Source
Unit
The unit of the value, if known. Some numeral systems have symbols built in that convey the unit
the number is of.
Declaration
public readonly TLanguageUnits? Unit
Field Value
| Type |
Description |
| System.Nullable<TLanguageUnits> |
|
|
Improve this Doc
View Source
Value
Declaration
public readonly decimal Value
Field Value
| Type |
Description |
| System.Decimal |
|
Methods
|
Improve this Doc
View Source
CompareTo(NumeralValue<TLanguageUnits>)
Declaration
public int CompareTo(NumeralValue<TLanguageUnits> other)
Parameters
Returns
| Type |
Description |
| System.Int32 |
|
|
Improve this Doc
View Source
Equals(NumeralValue<TLanguageUnits>)
Declaration
public bool Equals(NumeralValue<TLanguageUnits> other)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
| Type |
Name |
Description |
| System.Object |
obj |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type |
Description |
| System.Int32 |
|
|
Improve this Doc
View Source
ToString()
Declaration
public override string ToString()
Returns
| Type |
Description |
| System.String |
|
Operators
|
Improve this Doc
View Source
Equality(NumeralValue<TLanguageUnits>, NumeralValue<TLanguageUnits>)
Declaration
public static bool operator ==(NumeralValue<TLanguageUnits> left, NumeralValue<TLanguageUnits> right)
Parameters
| Type |
Name |
Description |
| NumeralValue<TLanguageUnits> |
left |
The left side of the operator.
|
| NumeralValue<TLanguageUnits> |
right |
The right side of the operator.
|
Returns
| Type |
Description |
| System.Boolean |
Whether left and right are value-equal.
|
|
Improve this Doc
View Source
Inequality(NumeralValue<TLanguageUnits>, NumeralValue<TLanguageUnits>)
Declaration
public static bool operator !=(NumeralValue<TLanguageUnits> left, NumeralValue<TLanguageUnits> right)
Parameters
| Type |
Name |
Description |
| NumeralValue<TLanguageUnits> |
left |
The left side of the operator.
|
| NumeralValue<TLanguageUnits> |
right |
The right side of the operator.
|
Returns
| Type |
Description |
| System.Boolean |
Whether left and right are not value-equal.
|
Implements
IEquatable<>
IComparable<>