@chriscodesthings/number-value
v1.0.0
Published
Function to return the value of a number, in number or string format
Downloads
2
Readme
number-value ·
Function to return the value of a number, in number or string format
Install
npm install --save @chriscodesthings/number-value
Use
import numberValue from '@chriscodesthings/number-value';
console.log(numberValue("123"));
// => 123
Syntax
numberValue(var);
Parameters
- var: any
Return Value
Returns a number if var is a number, or a string representation of a number, undefined
otherwise.
Note, values producing an
isNaN
result andInfinity
will return asundefined
.
Description
Does what it says on the tin.