NumExtensions extension

adds utility methods to num

on

Properties

isNonNegative bool

Available on num, provided by the NumExtensions extension

checkis if number is non negative
no setter
isNonPositive bool

Available on num, provided by the NumExtensions extension

checkis if number is non positive
no setter
isPositive bool

Available on num, provided by the NumExtensions extension

checks if number is positive
no setter
isZero bool

Available on num, provided by the NumExtensions extension

makes == 0 more readable
no setter

Methods

isMultipleOf(num number) bool

Available on num, provided by the NumExtensions extension

checks if is multiple of number
toPrecision(int places) double

Available on num, provided by the NumExtensions extension

specifies number of decimal places
withLeading(int width) String

Available on num, provided by the NumExtensions extension

pads left with number of zeros