is-negative

Check if something is a negative number

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
is-negative
2.1.08 years ago8 years agoMinified + gzip package size for is-negative in KB

Readme

is-negative Build Status
Check if something is a negative number

Install

$ npm install --save is-negative

Usage

const isNegative = require('is-negative');

isNegative(-1);
//=> true

isNegative(1);
//=> false

isNegative(0);
//=> false

isNegative('-1');
//=> false

isNegative(Number(-1))
//=> true

Note: This module doesn't consider -0 to be a negative number. If you want to detect -0, use the negative-zero module.

Related

License

MIT © Kevin Martensson