NumberUtils extension

on

Properties

isDouble bool

Available on num, provided by the NumberUtils extension

Returns true if the number is a double, false otherwise.
no setter
isEven bool

Available on num, provided by the NumberUtils extension

Returns true if the number is even, false otherwise.
no setter
isInteger bool

Available on num, provided by the NumberUtils extension

Returns true if the number is an integer, false otherwise.
no setter
isNegative bool

Available on num, provided by the NumberUtils extension

Returns true if the number is negative, false otherwise.
no setter
isOdd bool

Available on num, provided by the NumberUtils extension

Returns true if the number is odd, false otherwise.
no setter
isPositive bool

Available on num, provided by the NumberUtils extension

Returns true if the number is positive, false otherwise.
no setter
isZero bool

Available on num, provided by the NumberUtils extension

Returns true 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 contains substring. Returns true if the number contains substring, false otherwise.
count(num substring) int

Available on num, provided by the NumberUtils extension

Get count of a substring in the number. Returns the count of substring in the number.
digitsAfter(num substring) num

Available on num, provided by the NumberUtils extension

Get the digits after a substring in the number Returns the digits after a substring in the number
digitsAfterFirst(num substring) num

Available on num, provided by the NumberUtils extension

Get the digits after the first occurrence of substring in the number Returns the digits after the first occurrence of substring in the number
digitsAfterLast(num substring) num

Available on num, provided by the NumberUtils extension

Get the digits after the last occurrence of substring in the number Returns the digits after the last occurrence of substring in the number
digitsBefore(num substring) num

Available on num, provided by the NumberUtils extension

Get the digits before a substring in the number Returns the digits before a substring in the number
digitsBeforeFirst(num substring) num

Available on num, provided by the NumberUtils extension

Get the digits before the first occurrence of substring in the number Returns the digits before the first occurrence of substring in the number
digitsBeforeLast(num substring) num

Available on num, provided by the NumberUtils extension

Get the digits before the last occurrence of substring in the number Returns the digits before the last occurrence of substring in the number
digitsBetween(num start, num end) num

Available on num, provided by the NumberUtils extension

Get the digits between start and end in the number Returns the digits between start and end in the number
endsWith(num suffix) bool

Available on num, provided by the NumberUtils extension

Check if the number ends with suffix. Returns true if the number ends with suffix, false otherwise.
indexesOf(num substring) List<int>

Available on num, provided by the NumberUtils extension

get the index of all occurrences of substring in the number.
indexOfFirst(num substring) int

Available on num, provided by the NumberUtils extension

Get the index of the first occurrence of substring in the number.
indexOfLast(num substring) int

Available on num, provided by the NumberUtils extension

Get the index of the last occurrence of substring in the number. Returns the index of the last occurrence of substring in the number.
isInRange(num min, num max) bool

Available on num, provided by the NumberUtils extension

Check if the number is in the range min to max. Returns true if the number is in the range, false otherwise.
loremIpsum() String

Available on num, provided by the NumberUtils extension

Get the lorem ipsum text of this 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 with prefix. Returns true if the number starts with prefix, 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. If delimiter is not specified, the default is ','. If precision 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 specified precision. If precision is not specified, the default is 2.