_.toNumber(value)

sourcenpm package

Converts value to a number.

Since

4.0.0

Arguments

  • value (*): The value to process.

Returns

(number): Returns the number.

Example

  1. _.toNumber(3.2);
    // => 3.2
    _.toNumber(Number.MIN_VALUE);
    // => 5e-324
    _.toNumber(Infinity);
    // => Infinity
    _.toNumber('3.2');
    // => 3.2