You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.1 KiB

# is-decimal [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov]
<!--lint disable heading-increment list-item-spacing-->
Check if a character is decimal.
## Installation
[npm][npm-install]:
```bash
npm install is-decimal
```
## Usage
Dependencies:
```javascript
var decimal = require('is-decimal');
decimal('0'); // true
decimal('9'); // true
decimal('a'); // false
decimal('💩'); // false
```
## API
### `decimal(character)`
Check whether the given character code (`number`), or the character
code at the first position (`string`), is decimal.
## Related
* [`is-alphabetical`](https://github.com/wooorm/is-alphabetical)
* [`is-hexadecimal`](https://github.com/wooorm/is-hexadecimal)
## License
[MIT][license] © [Titus Wormer][author]
<!-- Definitions -->
[travis-badge]: https://img.shields.io/travis/wooorm/is-decimal.svg
[travis]: https://travis-ci.org/wooorm/is-decimal
[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/is-decimal.svg
[codecov]: https://codecov.io/github/wooorm/is-decimal
[npm-install]: https://docs.npmjs.com/cli/install
[license]: LICENSE
[author]: http://wooorm.com