NumberUtils extension
- on
Properties
- isDouble → bool
-
Available on num, provided by the NumberUtils extension
Returnstrueif the number is a double,falseotherwise.no setter - isEven → bool
-
Available on num, provided by the NumberUtils extension
Returnstrueif the number is even,falseotherwise.no setter - isInteger → bool
-
Available on num, provided by the NumberUtils extension
Returnstrueif the number is an integer,falseotherwise.no setter - isNegative → bool
-
Available on num, provided by the NumberUtils extension
Returnstrueif the number is negative,falseotherwise.no setter - isOdd → bool
-
Available on num, provided by the NumberUtils extension
Returnstrueif the number is odd,falseotherwise.no setter - isPositive → bool
-
Available on num, provided by the NumberUtils extension
Returnstrueif the number is positive,falseotherwise.no setter - isZero → bool
-
Available on num, provided by the NumberUtils extension
Returnstrueif the number is zero,falseotherwise.no setter
Methods
-
contains(
num substring) → bool -
Available on num, provided by the NumberUtils extension
Check if the number containssubstring. Returnstrueif the number containssubstring,falseotherwise. -
count(
num substring) → int -
Available on num, provided by the NumberUtils extension
Get count of asubstringin the number. Returns the count ofsubstringin the number. -
digitsAfter(
num substring) → num -
Available on num, provided by the NumberUtils extension
Get the digits after asubstringin the number Returns the digits after asubstringin the number -
digitsAfterFirst(
num substring) → num -
Available on num, provided by the NumberUtils extension
Get the digits after the first occurrence ofsubstringin the number Returns the digits after the first occurrence ofsubstringin the number -
digitsAfterLast(
num substring) → num -
Available on num, provided by the NumberUtils extension
Get the digits after the last occurrence ofsubstringin the number Returns the digits after the last occurrence ofsubstringin the number -
digitsBefore(
num substring) → num -
Available on num, provided by the NumberUtils extension
Get the digits before asubstringin the number Returns the digits before asubstringin the number -
digitsBeforeFirst(
num substring) → num -
Available on num, provided by the NumberUtils extension
Get the digits before the first occurrence ofsubstringin the number Returns the digits before the first occurrence ofsubstringin the number -
digitsBeforeLast(
num substring) → num -
Available on num, provided by the NumberUtils extension
Get the digits before the last occurrence ofsubstringin the number Returns the digits before the last occurrence ofsubstringin the number -
digitsBetween(
num start, num end) → num -
Available on num, provided by the NumberUtils extension
Get the digits betweenstartandendin the number Returns the digits betweenstartandendin the number -
endsWith(
num suffix) → bool -
Available on num, provided by the NumberUtils extension
Check if the number ends withsuffix. Returnstrueif the number ends withsuffix,falseotherwise. -
indexesOf(
num substring) → List< int> -
Available on num, provided by the NumberUtils extension
get the index of all occurrences ofsubstringin the number. -
indexOfFirst(
num substring) → int -
Available on num, provided by the NumberUtils extension
Get the index of the first occurrence ofsubstringin the number. -
indexOfLast(
num substring) → int -
Available on num, provided by the NumberUtils extension
Get the index of the last occurrence ofsubstringin the number. Returns the index of the last occurrence ofsubstringin the number. -
isInRange(
num min, num max) → bool -
Available on num, provided by the NumberUtils extension
Check if the number is in the rangemintomax. Returnstrueif the number is in the range,falseotherwise. -
loremIpsum(
) → String -
Available on num, provided by the NumberUtils extension
Get the lorem ipsum text ofthiswords. -
randomList(
{int min = 0, int max = 100}) → List< num> -
Available on num, provided by the NumberUtils extension
Get list of random numbers. -
startsWith(
num prefix) → bool -
Available on num, provided by the NumberUtils extension
Check if the number starts withprefix. Returnstrueif the number starts withprefix,falseotherwise. -
sumOfDigits(
) → num -
Available on num, provided by the NumberUtils extension
sum of digits Returns the sum of digits in the number. -
swapSign(
) → num -
Available on num, provided by the NumberUtils extension
Swap the sign of the number. -
toCurrencyString(
[String delimiter = ',', int precision = 2]) → String -
Available on num, provided by the NumberUtils extension
Convert to currency string with specified delimiter and precision. Ifdelimiteris not specified, the default is ','. Ifprecisionis not specified, the default is 2. -
toPrecision(
[int precision = 2]) → String -
Available on num, provided by the NumberUtils extension
Convert the number to a String with the specifiedprecision. Ifprecisionis not specified, the default is 2.