Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Static class: RT.Util.ExtensionMethods.NumericExtensions

Summary

Provides extension methods on numeric types.

Static methods

int
Clip(this int value, int minimumValue, int maximumValue)
Clips this value to the range defined by minimumValue and maximumValue. The returned number will be no less than the minimum value and no greater than the maximum value. Throws an exception if min value is greater than the max value.
double
Clip(this double value, double minimumValue, double maximumValue)
decimal
Clip(this decimal value, decimal minimumValue, decimal maximumValue)
int
ClipMax(this int value, int maximumValue)
Clips this value so that it is no greater than the maximum value specified.
double
ClipMax(this double value, double maximumValue)
decimal
ClipMax(this decimal value, decimal maximumValue)
int
ClipMin(this int value, int minimumValue)
Clips this value so that it is no less than the minimum value specified.
double
ClipMin(this double value, double minimumValue)
decimal
ClipMin(this decimal value, decimal minimumValue)
bool
IsBetween(this int value, int min, int max)
Determines whether value is between min and max (inclusive).
bool
IsBetween(this double value, double min, double max)
string
ToWords(this int number)
Converts the integer to a textual representation using English words. For example, 142.ToWords() is "one hundred and forty-two".
int?
TryParseAsInt(this string value)
Attempts to parse this string as an int, returning null if the parse fails.