is-negative

2.1.0 • Public • Published

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

  • is-positive - Check if something is a positive number

License

MIT © Kevin Martensson

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.1.0
    1,581
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.1.0
    1,581
  • 2.0.2
    0
  • 2.0.1
    0
  • 2.0.0
    706
  • 1.0.1
    1,154
  • 1.0.0
    2,661

Package Sidebar

Install

npm i is-negative

Weekly Downloads

5,144

Version

2.1.0

License

MIT

Last publish

Collaborators

  • kevva