is-positive

3.1.0 • Public • Published

is-positive Build Status

Check if something is a positive number

Install

$ npm install --save is-positive

Usage

const isPositive = require('is-positive');
 
isPositive(1);
//=> true
 
isPositive(0);
//=> false
 
isPositive(-1);
//=> false
 
isPositive('1');
//=> false
 
isPositive(Number(1))
//=> true

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

Related

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

License

MIT © Kevin Martensson

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 3.1.0
    5,193
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 3.1.0
    5,193
  • 3.0.0
    389
  • 2.0.0
    1,336
  • 1.0.0
    5,202

Package Sidebar

Install

npm i is-positive

Weekly Downloads

12,120

Version

3.1.0

License

MIT

Last publish

Collaborators

  • kevva