1 | # is-decimal
|
---|
2 |
|
---|
3 | [![Build][build-badge]][build]
|
---|
4 | [![Coverage][coverage-badge]][coverage]
|
---|
5 | [![Downloads][downloads-badge]][downloads]
|
---|
6 | [![Size][size-badge]][size]
|
---|
7 |
|
---|
8 | Check if a character is decimal.
|
---|
9 |
|
---|
10 | ## Install
|
---|
11 |
|
---|
12 | [npm][]:
|
---|
13 |
|
---|
14 | ```sh
|
---|
15 | npm install is-decimal
|
---|
16 | ```
|
---|
17 |
|
---|
18 | ## Use
|
---|
19 |
|
---|
20 | ```js
|
---|
21 | var decimal = require('is-decimal')
|
---|
22 |
|
---|
23 | decimal('0') // => true
|
---|
24 | decimal('9') // => true
|
---|
25 | decimal('a') // => false
|
---|
26 | decimal('💩') // => false
|
---|
27 | ```
|
---|
28 |
|
---|
29 | ## API
|
---|
30 |
|
---|
31 | ### `decimal(character|code)`
|
---|
32 |
|
---|
33 | Check whether the given character code (`number`), or the character code at the
|
---|
34 | first position (`string`), is decimal.
|
---|
35 |
|
---|
36 | ## Related
|
---|
37 |
|
---|
38 | * [`is-alphabetical`](https://github.com/wooorm/is-alphabetical)
|
---|
39 | * [`is-hexadecimal`](https://github.com/wooorm/is-hexadecimal)
|
---|
40 | * [`is-whitespace-character`](https://github.com/wooorm/is-whitespace-character)
|
---|
41 | * [`is-word-character`](https://github.com/wooorm/is-word-character)
|
---|
42 |
|
---|
43 | ## License
|
---|
44 |
|
---|
45 | [MIT][license] © [Titus Wormer][author]
|
---|
46 |
|
---|
47 | <!-- Definitions -->
|
---|
48 |
|
---|
49 | [build-badge]: https://img.shields.io/travis/wooorm/is-decimal.svg
|
---|
50 |
|
---|
51 | [build]: https://travis-ci.org/wooorm/is-decimal
|
---|
52 |
|
---|
53 | [coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/is-decimal.svg
|
---|
54 |
|
---|
55 | [coverage]: https://codecov.io/github/wooorm/is-decimal
|
---|
56 |
|
---|
57 | [downloads-badge]: https://img.shields.io/npm/dm/is-decimal.svg
|
---|
58 |
|
---|
59 | [downloads]: https://www.npmjs.com/package/is-decimal
|
---|
60 |
|
---|
61 | [size-badge]: https://img.shields.io/bundlephobia/minzip/is-decimal.svg
|
---|
62 |
|
---|
63 | [size]: https://bundlephobia.com/result?p=is-decimal
|
---|
64 |
|
---|
65 | [npm]: https://docs.npmjs.com/cli/install
|
---|
66 |
|
---|
67 | [license]: license
|
---|
68 |
|
---|
69 | [author]: https://wooorm.com
|
---|