# isnumeric

> Determine if a JavaScript object is numeric

Latest version **0.3.3** (published 2018-03-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install isnumeric
pnpm add isnumeric
yarn add isnumeric
bun add isnumeric
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.3 |
| Published | 2018-03-23 |
| First published | 2013-09-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.x |
| Dependencies | 0 |
| Unpacked size | 10.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Lee Crossley |
| Maintainers | leecrossley |
| Keywords | isnumeric, numeric, number |

## Links

- npm: https://www.npmjs.com/package/isnumeric
- Repository: https://github.com/leecrossley/isNumeric
- Homepage: http://ilee.co.uk
- Issues: https://github.com/leecrossley/isNumeric/issues
- npm.io page: https://npm.io/package/isnumeric

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 0.3.3 (latest) — 2018-03-23
- 0.3.2 — 2017-03-16
- 0.3.1 — 2015-10-10
- 0.3.0 — 2015-10-10
- 0.2.0 — 2015-04-15
- 0.1.5 — 2015-02-24
- 0.1.4 — 2015-01-02
- 0.1.3 — 2014-12-07
- 0.1.2 — 2014-08-01
- 0.1.1 — 2014-06-17
- 0.0.10 — 2014-02-07
- 0.0.9 — 2014-01-10
- 0.0.7 — 2013-10-28
- 0.0.6 — 2013-10-11
- 0.0.5 — 2013-09-26
- … 4 more at https://npm.io/package/isnumeric/versions

## README

# isNumeric [![Build Status](https://travis-ci.org/leecrossley/isNumeric.png?branch=master)](https://travis-ci.org/leecrossley/isNumeric) [![npm version](https://badge.fury.io/js/isnumeric.png)](https://npmjs.org/package/isnumeric) [![devDependency Status](https://david-dm.org/leecrossley/isNumeric/dev-status.png)](https://david-dm.org/leecrossley/isNumeric#info=devDependencies)

Determine if a JavaScript object is numeric.

### Using npm

```
npm install isnumeric
```

To then include isnumeric in your node app:

```
var isNumeric = require("isnumeric");
```

### Direct dependency

Download the minified version [here](http://bit.ly/isnumeric), reference the js file and isNumeric will become a global variable.


## Truthy test cases

### Integers

```javascript
expect(isNumeric(1)).toBeTruthy();
expect(isNumeric(-1)).toBeTruthy();
expect(isNumeric(0)).toBeTruthy();
expect(isNumeric("1")).toBeTruthy();
expect(isNumeric("-1")).toBeTruthy();
expect(isNumeric("0")).toBeTruthy();
expect(isNumeric("1.")).toBeTruthy();
```

### Max / min numbers

```javascript
expect(isNumeric(Number.MAX_VALUE)).toBeTruthy();
expect(isNumeric(Number.MIN_VALUE)).toBeTruthy();
```

### Octals

```javascript
expect(isNumeric(0144)).toBeTruthy();
expect(isNumeric("0144")).toBeTruthy();
```

### Hexadecimals

```javascript
expect(isNumeric(0xFF)).toBeTruthy();
expect(isNumeric("0xFF")).toBeTruthy();
```

### Floating-points

```javascript
expect(isNumeric(1.1)).toBeTruthy();
expect(isNumeric(0.1)).toBeTruthy();
expect(isNumeric(-1.1)).toBeTruthy();
expect(isNumeric(-0.1)).toBeTruthy();
expect(isNumeric("1.1")).toBeTruthy();
expect(isNumeric("0.1")).toBeTruthy();
expect(isNumeric("-1.1")).toBeTruthy();
expect(isNumeric("-0.1")).toBeTruthy();
expect(isNumeric(".1")).toBeTruthy();
```

### Exponentials

```javascript
expect(isNumeric(3e5)).toBeTruthy();
expect(isNumeric(123e-2)).toBeTruthy();
expect(isNumeric("3e5")).toBeTruthy();
expect(isNumeric("123e-2")).toBeTruthy();
```

### Decimal commas

```javascript
expect(isNumeric(1,1)).toBeTruthy();
expect(isNumeric("1,1")).toBeTruthy();
```

---
_Source: https://npm.io/package/isnumeric · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
