parse-int
Strict integer parsing
Last updated 2 years ago by bendrucker .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install parse-int 
SYNC missed versions from official npm registry.

parse-int Build Status Greenkeeper badge

Strict integer parsing. If it's not an actual integer or an integer string, return undefined.

Install

$ npm install --save parse-int

Usage

var parseInt = require('parse-int');

parseInt(2) // 2
parseInt('2') // 2
parseInt('2.2') // undefined
parseInt(1.2) // undefined
parseInt('2a') // undefined
parseInt() // undefined

API

parseInt(number) -> number / undefined

number

Required
Type: any

The number to attempt to parse.

License

MIT © Ben Drucker

Current Tags

  • 1.0.3                                ...           latest (2 years ago)

4 Versions

  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           6 years ago

Copyright 2014 - 2017 © taobao.org |