Method | Description | |
---|---|---|
AsPercentage ( this rate ) : string |
Formats a rate as a percentage.
|
|
DivDown ( this a, int b ) : int |
Integer division that always rounds down Equivilant to a/b in many languages. It complements the modulo operation.
|
|
GreaterOf ( int first, int second ) : int |
Returns the passed-in value that is greatest. If both values are the same returns the first
|
|
Inc ( this start, int increment = 1 ) : IEnumerable |
Starting at start, generate an infinite sequence of numbers, incrementing by increment. WARNING: Generates an infinite (or nearly infinite) sequence, so call Take() on this or something, or your program will be here forever.
|
|
IsAbout ( this number, decimal other, decimal precision ) : bool |
Is number the same as other, to within precision ie, 1.01m.IsAbout(1.0m, .1m) means "is 1.01 equal 1.0 to within .1?"
|
|
IsEven ( this num ) : bool | ||
IsOdd ( this num ) : bool | ||
LesserOf ( int first, int second ) : int |
Returns the passed-in value that is smallest. If both values are the same returns the first
|
|
Mod ( this a, int b ) : int |
The integer modulo where the divisor's sign is maintained, not the the dividends. If the dividend's sign is maintained, it is typically called the remainder. For example, (-3).Mod(5) == 2, this is different from the `%` in C#.
|
|
PrintDecimal ( this o ) : string | ||
RoundTo ( this number, int decimalPlaces, MidpointRounding roundingRule = MidpointRounding.AwayFromZero ) : decimal |
A wrapper around Decimal.Round
|
|
Times ( this num, System.Action action ) : void |
Perform some action num times
|
|
To ( this start, int end, int increment = null ) : IEnumerable |
Get a list of numbers from start to end (inclusive), incrementing by increment
|
|
ToOrdinal ( this i ) : string |
Converts 1 to 1st, 2 to 2nd, etc
|
public static AsPercentage ( this rate ) : string | ||
rate | this | The rate specified as decimal. |
return | string |
public static DivDown ( this a, int b ) : int | ||
a | this | |
b | int | |
return | int |
public static GreaterOf ( int first, int second ) : int | ||
first | int | |
second | int | |
return | int |
public static Inc ( this start, int increment = 1 ) : IEnumerable |
||
start | this | |
increment | int | |
return | IEnumerable |
public static IsAbout ( this number, decimal other, decimal precision ) : bool | ||
number | this | |
other | decimal | |
precision | decimal | |
return | bool |
public static LesserOf ( int first, int second ) : int | ||
first | int | |
second | int | |
return | int |
public static PrintDecimal ( this o ) : string | ||
o | this | |
return | string |
public static RoundTo ( this number, int decimalPlaces, MidpointRounding roundingRule = MidpointRounding.AwayFromZero ) : decimal | ||
number | this | |
decimalPlaces | int | |
roundingRule | MidpointRounding | |
return | decimal |
public static Times ( this num, System.Action action ) : void | ||
num | this | |
action | System.Action | |
return | void |
public static To ( this start, int end, int increment = null ) : IEnumerable |
||
start | this | |
end | int | |
increment | int | defaults to 1 or -1 |
return | IEnumerable |