NumberUtils extension
- on
Properties
- isDouble → bool
-
Available on num, provided by the NumberUtils extension
Returnstrue
if the number is a double,false
otherwise.no setter - isEven → bool
-
Available on num, provided by the NumberUtils extension
Returnstrue
if the number is even,false
otherwise.no setter - isInteger → bool
-
Available on num, provided by the NumberUtils extension
Returnstrue
if the number is an integer,false
otherwise.no setter - isNegative → bool
-
Available on num, provided by the NumberUtils extension
Returnstrue
if the number is negative,false
otherwise.no setter - isOdd → bool
-
Available on num, provided by the NumberUtils extension
Returnstrue
if the number is odd,false
otherwise.no setter - isPositive → bool
-
Available on num, provided by the NumberUtils extension
Returnstrue
if the number is positive,false
otherwise.no setter - isZero → bool
-
Available on num, provided by the NumberUtils extension
Returnstrue
if the number is zero,false
otherwise.no setter
Methods
-
contains(
num substring) → bool -
Available on num, provided by the NumberUtils extension
Check if the number containssubstring
. Returnstrue
if the number containssubstring
,false
otherwise. -
count(
num substring) → int -
Available on num, provided by the NumberUtils extension
Get count of asubstring
in the number. Returns the count ofsubstring
in the number. -
digitsAfter(
num substring) → num -
Available on num, provided by the NumberUtils extension
Get the digits after asubstring
in the number Returns the digits after asubstring
in the number -
digitsAfterFirst(
num substring) → num -
Available on num, provided by the NumberUtils extension
Get the digits after the first occurrence ofsubstring
in the number Returns the digits after the first occurrence ofsubstring
in the number -
digitsAfterLast(
num substring) → num -
Available on num, provided by the NumberUtils extension
Get the digits after the last occurrence ofsubstring
in the number Returns the digits after the last occurrence ofsubstring
in the number -
digitsBefore(
num substring) → num -
Available on num, provided by the NumberUtils extension
Get the digits before asubstring
in the number Returns the digits before asubstring
in the number -
digitsBeforeFirst(
num substring) → num -
Available on num, provided by the NumberUtils extension
Get the digits before the first occurrence ofsubstring
in the number Returns the digits before the first occurrence ofsubstring
in the number -
digitsBeforeLast(
num substring) → num -
Available on num, provided by the NumberUtils extension
Get the digits before the last occurrence ofsubstring
in the number Returns the digits before the last occurrence ofsubstring
in the number -
digitsBetween(
num start, num end) → num -
Available on num, provided by the NumberUtils extension
Get the digits betweenstart
andend
in the number Returns the digits betweenstart
andend
in the number -
endsWith(
num suffix) → bool -
Available on num, provided by the NumberUtils extension
Check if the number ends withsuffix
. Returnstrue
if the number ends withsuffix
,false
otherwise. -
indexesOf(
num substring) → List< int> -
Available on num, provided by the NumberUtils extension
get the index of all occurrences ofsubstring
in the number. -
indexOfFirst(
num substring) → int -
Available on num, provided by the NumberUtils extension
Get the index of the first occurrence ofsubstring
in the number. -
indexOfLast(
num substring) → int -
Available on num, provided by the NumberUtils extension
Get the index of the last occurrence ofsubstring
in the number. Returns the index of the last occurrence ofsubstring
in the number. -
isInRange(
num min, num max) → bool -
Available on num, provided by the NumberUtils extension
Check if the number is in the rangemin
tomax
. Returnstrue
if the number is in the range,false
otherwise. -
loremIpsum(
) → String -
Available on num, provided by the NumberUtils extension
Get the lorem ipsum text ofthis
words. -
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
. Returnstrue
if the number starts withprefix
,false
otherwise. -
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. Ifdelimiter
is not specified, the default is ','. Ifprecision
is 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
. Ifprecision
is not specified, the default is 2.