GH_DigitNumber

References
public class GH_DigitNumber
Maintains and provides functionality for evaluating and modifying numbers as used in the GH_DigitScrollerBase control.

Constructors

GH_DigitNumber

#
public GH_DigitNumber(GH_DigitNumber other)
Create an exact duplicate of another GH_DigitNumber instance.
other (GH_DigitNumber)Number to copy.

GH_DigitNumber

#
public GH_DigitNumber(int decimalPlaces, int radixPosition)
Create a new GH_DigitNumber instance with the specified number of decimal places and a given radix position.
decimalPlaces (int)Amount of decimal places
radixPosition (int)Index of radix symbol, -1 to disable the radix altogether.

GH_DigitNumber

#
public GH_DigitNumber(int decimalPlaces)
Create a new GH_DigitNumber instance with the specified number of decimal places.
decimalPlaces (int)Amount of decimal places.

Properties

DigitCount

#
public int DigitCount { get; }
Gets or sets the amount of digits in this number.

Epsilon

#
public decimal Epsilon { get; }
Gets the smallest possible change.

IsPrimaryDigitSignificant

#
public bool IsPrimaryDigitSignificant[int index] { get; }
Gets whether the primary digit at the given index is significant.
index (int)Index of digit to test.

IsSecondaryDigitSignificant

#
public bool IsSecondaryDigitSignificant[int index] { get; }
Gets whether the secondary digit at the given index is significant.
index (int)Index of digit to test.

Maximum

#
public decimal Maximum { get; set; }
Gets the maximum value allowed in this number.

Minimum

#
public decimal Minimum { get; set; }
Gets the minimum value allowed in this number.

Offset

#
public decimal Offset { get; }
Gets the offset between the primary and secondary digits.

PrimaryDigits

#
public IList<int> PrimaryDigits { get; }
Gets the internal list of primary digits. Do not modify this list.

PrimaryPositive

#
public bool PrimaryPositive { get; set; }
Gets or sets a value indicating whether the number is positive.

Radix

#
public int Radix { get; set; }
Gets or sets the radix point index. A negative radix index disables the radix point, zero is not a valid index.

RadixIndex

#
public int RadixIndex { get; }
Gets the mapped radix.

SecondaryDigits

#
public IList<int> SecondaryDigits { get; }
Gets the internal list of secondary digits. Do not modify this list.

SecondaryPositive

#
public bool SecondaryPositive { get; }
Gets a value indicating whether the secondary number is positive.

Value

#
public decimal Value { get; set; }
Gets or sets the value of this number.

Methods

AssignOffset

#
public bool AssignOffset(int index, decimal offset)
Assign an offset to a given digit and recursively adjust all leftwards offsets if needed.
index (int)Index of digit to offset.
offset (decimal)New offset for digit.
True on success, false on failure.

LimitValue

#
public void LimitValue()
Limits the value to the minimum and maximum domain.

Reset

#
public void Reset()
Reset all parts to zero.

Round

#
public void Round()
Round the number by cancelling the offset in the proper direction.

ToString

#
public override string ToString()
Object.ToString