Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/blakeembrey/node-numbered
Stringify any number into words, and parse number strings back to a number
https://github.com/blakeembrey/node-numbered
number-to-words words-to-numbers
Last synced: about 6 hours ago
JSON representation
Stringify any number into words, and parse number strings back to a number
- Host: GitHub
- URL: https://github.com/blakeembrey/node-numbered
- Owner: blakeembrey
- Created: 2013-04-11T07:17:47.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2023-12-12T06:58:15.000Z (about 1 year ago)
- Last Synced: 2024-10-13T15:02:00.842Z (3 months ago)
- Topics: number-to-words, words-to-numbers
- Language: JavaScript
- Homepage:
- Size: 27.3 KB
- Stars: 24
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Numbered
[![NPM version](https://img.shields.io/npm/v/numbered.svg?style=flat)](https://npmjs.org/package/numbered)
[![Build status](https://img.shields.io/travis/blakeembrey/node-numbered.svg?style=flat)](https://travis-ci.org/blakeembrey/node-numbered)
[![Test coverage](https://img.shields.io/coveralls/blakeembrey/node-numbered.svg?style=flat)](https://coveralls.io/r/blakeembrey/node-numbered?branch=master)
[![Greenkeeper badge](https://badges.greenkeeper.io/blakeembrey/node-numbered.svg)](https://greenkeeper.io/)> Stringify any number into words, and parse number strings back to a number.
## Installation
```
npm install numbered --save
```## API
```javascript
var numbered = require('numbered');
```* [`numbered(number | string)`](#function)
* [`numbered.parse(string)`](#parse)
* [`numbered.stringify(number)`](#stringify)### Function
**Numbered** exposes a single function that accepts either a string or a number. The string will delegate to the `parse` method and a number will delegate to the `stringify` method.
### Parse
Parses a string into a number as best as possible.
```js
numbered.parse('ninety nine');
// 99numbered.parse('point two five nine');
// 0.259
```### Stringify
Stringifies a number to the words.
```js
numbered.stringify(99);
// "ninety nine"numbered.stringify(0.259);
// "zero point two five nine"
```## License
MIT