UiNumber
References[IoId("00000000-ae61-4a68-ad31-356dbdee157f")]
[DebuggerDisplay("{ToStringFull(),nq}")]
public sealed class UiNumber : IComparable<UiNumber>, IEquatable<UiNumber>, IStorable
A number with controllable limits and decimal places. This type of number is not fast, do not use it for actual mathematics.
Constructors
Fields
Properties
NormalisedValue
#Gets the value as a normalised unit. This doesn't work too well if the number domain is _huge_.
Range
#Gets the limit range. Careful, if the number is not limited this value is probably just decimal.MaxValue.
Ticks
#Gets the total amount of unique 'ticks' in the current range. This number may be larger than the actual accuracy the decimal type supports on the current range.
Methods
CompareTo
#Compare this number with another. Only the value is taken into consideration.
Parameters:
| other (UiNumber) | Number to compare against. |
Returns: Sorting key.
ComputeSensibleLimits
#Compute sensible limits for a value.
Decrement
#Decrement this number by the smallest possible amount.
Returns: Decremented number, or the same number of decrementation is not possible.
Equals
#Determines whether the specified object is equal to the current object.
Parameters:
| obj (object) |
Returns: True if the value of this number is equal to the supplied number.
Overrides: Object.Equals
Equals
#Gets whether this number is equal to some other number. Only values are considered in this equality.
Parameters:
| other (UiNumber) | Number to test against. |
Returns: True if both numbers have the same value.
EqualsFull
#Gets whether this number is equal to some other number. Value, limits and decimals are all taken into consideration.
Parameters:
| other (UiNumber) | Number to test against. |
Returns: True if both numbers are identical.
FormatValue
#Format a value using the current decimal pattern.
Parameters:
| value (decimal) | Value to format. |
Returns: Formatted value.
GetHashCode
#Serves as the default hash function.
Returns: A hash code for the current object.
Overrides: Object.GetHashCode
Increment
#Increment this number by the smallest possible amount.
Returns: Incremented number, or the same number of incrementation is not possible.
LimitValue
#Constrain a value to the current lower and upper limits.
Parameters:
| value (decimal) | Value to limit. |
Returns: Limited value.
ProcessValue
#Process a value by both limiting and rounding it.
Parameters:
| value (decimal) | Value to process. |
Returns: Processed value.
RoundValue
#Process a value by rounding it.
Parameters:
| value (decimal) | Value to round. |
Returns: Rounded value.
ToString
#Returns a string that represents the current object.
Returns: A string that represents the current object.
Overrides: Object.ToString
ToStringFull
#Returns a string that represents the current object.
Returns: A string that represents the current object.
TryParse
#Try and parse a string as a UiNumber.
TryParse
#Try and parse a string as a UiNumber.
WithDecimals
#Change the decimal count of this UiNumber.
Parameters:
| decimals (int) | New decimal count. |
Returns: Modified ui number.
WithIndexedValue
#Change the value of this number by specifying a new tick.
Parameters:
| tick (long) | New tick. |
Returns: Modified number.
WithLimits
#Change the limits of this number.