NumUtilities extension

Extends num with additional basic methods.

on

Properties

invert num
Flips the sign of this number.
no setter
isPositive bool
true if the number is positive; otherwise, false.
no setter

Methods

equals(num other, [num? roundTo]) bool
Returns true if other equals this number.
isWithin(String expression) bool
Returns true if this number matches or is within the range of any of the parts defined in expression.
isWithinRange(num start, num end) bool
Returns true if this number is within the range of start to end.
roundTo(num value) num
Rounds this number by value:
roundToPrecision(int precision) num
Rounds this number to precision decimal points.