Number Module
References
Create
Distribution
Filter
Formatting
Math
Parse
Query
References
Create Functions
-
Returns an Observable that emits a sequence of numbers in the Fibonacci sequence, starting from
0
Parameters
-
iterations: number
The number of iterations to do, must be greater than
0
-
emitDelay: number = 0
If set the observable will emit per millisecond set, by default this is 0
Returns Observable < number >
Observable of a Fibonacci sequence of numbers starting from
0
-
-
Returns an Observable that emits numbers as a type-safe number generator from a source, if no source is passed it will generate an infinite sequence of positive numbers starting from 0
Type parameters
-
T: number
Parameters
-
Optional input: Subscribable<Iterable<T> | T> | Iterable<T> | T
Optional number source to emit from
Returns Observable < number >
Observable that emits numbers passed from arguments or array
-
Distribution Functions
-
Returns an Observable that emits the maximum number value from an Iterable of numbers
Returns OperatorFunction < Iterable < number > , number >
Observable that emits a number that is the maximum value in the source Iterable
-
Returns an Observable that emits the calculated mean number value from an Iterable of numbers
Parameters
-
precision: Subscribable<number> | number = 3
Precision to round the result to, default is
3
Returns OperatorFunction < Iterable < number > , number >
Observable that emits a number that is the mean of all values in the source Iterable
-
-
Returns an Observable that emits the median number value from an Iterable of numbers
Parameters
-
precision: Subscribable<number> | number = 3
Returns OperatorFunction < Iterable < number > , number >
Observable that emits a number that is the median value in the source Iterable
-
-
Returns an Observable that emits the minimum number value from an Iterable of numbers
Returns OperatorFunction < Iterable < number > , number >
Observable that emits a number that is the minimum value in the source Iterable
Filter Functions
-
Returns an Observable that emits numbers, where that number falls between the provided
min
andmax
values.Parameters
-
min: Subscribable<number> | number
The minimum range value
-
max: Subscribable<number> | number
The maximum range value
-
Optional excludeBounds: Subscribable<boolean> | boolean
Also filter the
min
andmax
values from the Observable
Returns MonoTypeOperatorFunction < number >
Observable that emits a number that falls within the passed
min
andmax
range -
-
Returns an Observable that emits numbers from a source where they pass the check of Number.isFinite.
Returns MonoTypeOperatorFunction < number >
Observable that emits numbers that are finite
-
Returns an Observable that emits only valid finite floating point numbers from a source
Returns MonoTypeOperatorFunction < number >
Observable that emits valid finite floating point numbers
-
Returns an Observable that emits only integer numbers from a source that pass the check of Number.isInteger.
Returns MonoTypeOperatorFunction < number >
Observable that emits integer numbers
-
Returns an Observable that emits numbers that are within the safe number range for JavaScript number precision using Number.isSafeInteger
Returns MonoTypeOperatorFunction < number >
Observable that emits integer numbers within
Number.isSafeInteger
equality check
-
Returns an Observable that emits number values from a source filtering out any NaN values.
Returns MonoTypeOperatorFunction < number >
Observable that emits valid numbers and excludes NaN values
-
Returns an Observable that emits numbers, where that number falls outside the provided
min
andmax
values.Parameters
-
min: Subscribable<number> | number
The minimum range value
-
max: Subscribable<number> | number
The maximum range value
-
Optional includeBounds: Subscribable<boolean> | boolean
Optionally include the
min
andmax
values in the Observable
Returns MonoTypeOperatorFunction < number >
Observable that emits a number that falls outside the
min
andmax
ranges -
Formatting Functions
-
Returns an Observable that emits a formatted string of a number raised to an exponential power using Number.toExponential
Parameters
-
exponential: Subscribable<number> | number
The exponential value to raise the number by
Returns OperatorFunction < number , string >
Observable that emits a formatted string of the exponential number
-
-
Returns an Observable that emits a formatted string value from a source number using Number.toFixed
Parameters
-
Optional digits: Subscribable<number> | number
Optional number of digits to fix to, if not passed treated as
0
Returns OperatorFunction < number , string >
Observable that emits a formatted string from a source number to a fixed decimal value
-
-
Returns an Observable that emits a string that is the hex value of a source number
Returns OperatorFunction < number , string >
Observable that emits the hex value of a source number
-
Returns an Observable that emits a formatted string value from a source number using Number.toLocaleString with optional formatting options provided by Intl.NumberFormat
Parameters
-
Optional locales: Subscribable<string | string[]> | string | string[]
The locale or locales that the number is being formatted for
-
Optional format: Subscribable<Intl.NumberFormatOptions> | Intl.NumberFormatOptions
Formatting of the string based on Intl.NumberFormat
Returns OperatorFunction < number , string >
Observable that emits a formatted string from a source number
-
-
Returns an Observable that emits a formatted string value from a source number using Number.toPrecision.
Parameters
-
precision: Subscribable<number> | number
The number of decimal places to format the precision to.
Returns OperatorFunction < number , string >
Observable that emits a formatted string from a source number
-
-
Returns an Observable that emits a formatted string value from a source number using Number.toString
Parameters
-
radix: Subscribable<number> | number = 10
The base number to format to. Default is
10
.
Returns OperatorFunction < number , string >
Observable that emits a formatted string from a source number and passed
radix
value -
Math Functions
-
Returns an Observable that emits a number that is the addition of the source number with input number
Parameters
-
num: Subscribable<number> | number
The number to add to the source value
Returns MonoTypeOperatorFunction < number >
Observable that emits a number that is the addition of source and input
-
-
Returns an Observable that emits a number that is the division of the source number with input number
Parameters
-
num: Subscribable<number> | number
The number to divide to the source value
Returns MonoTypeOperatorFunction < number >
Observable that emits a number that is the division of source and input
-
-
Returns an Observable that emits a number that is the remainder of the Modulo operation of the source number by the divider
Parameters
-
modulus: Subscribable<number> | number
The dividing number for the Modulo operation
Returns MonoTypeOperatorFunction < number >
Observable that emits a number that is reminder of a Modulo operation
-
-
Returns an Observable that emits a number that is the multiplication of the source number with input number
Parameters
-
num: Subscribable<number> | number
The number to multiply to the source value
Returns MonoTypeOperatorFunction < number >
Observable that emits a number that is the multiplication of source and input
-
-
Returns an Observable that emits a number from a source number that is raised by the passed power using the exponentiation operator
**
Parameters
-
power: Subscribable<number> | number
The number to raise the value by
Returns MonoTypeOperatorFunction < number >
Observable that emits a number that is the raised source value by the power
-
-
Returns an Observable that emits a number value rounded to the number of digits passed
Parameters
-
precision: Subscribable<number> | number
Maximum number of digits to round the number to
Returns MonoTypeOperatorFunction < number >
Observable that emits a number number to a fixed decimal value
-
-
Returns an Observable that emits a number that is the subtraction of the source number with input number
Parameters
-
num: Subscribable<number> | number
The number to subtract to the source value
Returns MonoTypeOperatorFunction < number >
Observable that emits a number that is the subtraction of source and input
-
Parse Functions
-
Returns an Observable that emits a number from a source string using Number.parseFloat.
Returns OperatorFunction < string , number >
Observable that emits a number from source parsed string
-
Returns an Observable that emits a number from a source hex using Number.parseInt.
Returns OperatorFunction < string , number >
Observable that emits a number from source hex value
-
Returns an Observable that emits a number from a source string using Number.parseInt.
Parameters
-
radix: Subscribable<number> | number = 10
The number base to convert from. Default is base
10
Returns OperatorFunction < string , number >
Observable that emits a number from source parsed string, optionally returns NaN values
-
Query Functions
-
Returns an Observable that emits booleans about values from a source that fall within the passed
min
andmax
range, including the range numbers.Parameters
-
min: Subscribable<number> | number
The minimum number for the range
-
max: Subscribable<number> | number
The maximum number for the range
-
Optional excludeBounds: Subscribable<boolean> | boolean
Optionally filter the
min
andmax
values from the Observable
Returns OperatorFunction < number , boolean >
Observable that emits a boolean if the source number falls within the passed
min
andmax
range -
-
Returns an Observable that emits a boolean value when a source number is a finite number using Number.isFinite
Returns OperatorFunction < number , boolean >
Observable that emits a boolean of a source number being finite
-
Returns an Observable that emits a boolean value when a source number is a a valid finite floating point number
Returns OperatorFunction < number , boolean >
Observable that emits a boolean of a source number is a valid finite floating point
-
Returns an Observable that emits a boolean value when a source number is an integer checked with Number.isInteger
Returns OperatorFunction < number , boolean >
Observable that emits a boolean of a source number being an integer
-
Returns an Observable that emits a boolean is the source number has no remainder from the passed modulus
Parameters
-
modulus: Subscribable<number> | number
The dividing number for the Modulo operation
Returns OperatorFunction < number , boolean >
Observable that emits a boolean is the source number has no remainder
-
-
Returns an Observable that emits a boolean value when a source number is a NaN value from Number.isNaN.
Returns OperatorFunction < number , boolean >
Observable that emits a boolean value of a number being valid or NaN
-
Returns an Observable that emits a boolean value when a source number is valid and not NaN, checked using Number.isNaN
Returns OperatorFunction < number , boolean >
Observable that emits a boolean value of a number being valid or NaN
-
Returns an Observable that emits a boolean value when a source number has precision safety using Number.isSafeInteger
Returns OperatorFunction < number , boolean >
Observable that emits a boolean value of a number has precision safety
-
Returns an Observable that emits booleans about values from a source that fall outside the passed
min
andmax
range, excluding the range numbers.Parameters
-
min: Subscribable<number> | number
The minimum number for the range
-
max: Subscribable<number> | number
The maximum number for the range
-
Optional includeBounds: Subscribable<boolean> | boolean
Optionally include the
min
andmax
values in the Observable
Returns OperatorFunction < number , boolean >
Observable that emits a boolean if the source number falls outside the passed
min
andmax
range -
Generated using TypeDoc, the 18/11/2022 at 13:22:58
The RxJS Ninja Number module contains operators for working with, and returning number values. The operators allow for filtering, querying, converting to and from String, and mathematical operations.