The name of the environment variable to look for in process.env.
A float
corresponding to the parsed variable's value, if any, else
undefined
.
An Error instance explaining that the variable was present, but that it could not be parsed into a valid float.
Internally, this function uses Number.parseFloat to try to convert the string
into a number. That means, for example, that a value like "123.5_test" will yield "123.5"
instead of failing. In other words, if Number.parseFloat returns something other than
NaN
, this function won't throw.
Generated using TypeDoc
A function that tries to retrieve an environment variable from the process.env object and, if it succeeds, validates that it can be parsed as a
float
value, and, if so, returns it as anumber
value. If no variable is found, this function returnsundefined
.