@chriscodesthings/number-value

1.0.0 • Public • Published

number-value · Test workflow status NPM Version License: MIT

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 and Infinity will return as undefined.

Description

Does what it says on the tin.

Readme

Keywords

Package Sidebar

Install

npm i @chriscodesthings/number-value

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

4.21 kB

Total Files

6

Last publish

Collaborators

  • chriscodesthings