|
|
@@ -1,27 +1,36 @@ |
|
|
|
# TSDX Bootstrap |
|
|
|
# number-name |
|
|
|
|
|
|
|
This project was bootstrapped with [TSDX](https://github.com/jaredpalmer/tsdx). |
|
|
|
Converts a number into its name. |
|
|
|
|
|
|
|
## Local Development |
|
|
|
[See the demo here.](https://Temoto-kun.github.io/number-name) |
|
|
|
|
|
|
|
Below is a list of commands you will probably find useful. |
|
|
|
## Why? |
|
|
|
|
|
|
|
### `npm start` or `yarn start` |
|
|
|
Inspired by [number-to-words](https://www.npmjs.com/package/number-to-words). Thinking I could improve on the code to include |
|
|
|
[big integers](https://www.npmjs.com/package/big-integer), I looked for some info and found [Landon Curt Noll's Web page describing |
|
|
|
the reconstructed English naming system of numbers](http://www.isthe.com/chongo/tech/math/number/howhigh.html). I decided to port |
|
|
|
his [Perl script](http://www.isthe.com/chongo/tech/math/number/number) into JavaScript. |
|
|
|
|
|
|
|
Runs the project in development/watch mode. Your project will be rebuilt upon changes. TSDX has a special logger for you convenience. Error messages are pretty printed and formatted for compatibility VS Code's Problems tab. |
|
|
|
## Installation |
|
|
|
|
|
|
|
<img src="https://user-images.githubusercontent.com/4060187/52168303-574d3a00-26f6-11e9-9f3b-71dbec9ebfcb.gif" width="600" /> |
|
|
|
Install via Yarn: |
|
|
|
|
|
|
|
Your library will be rebuilt if you make edits. |
|
|
|
```shell script |
|
|
|
yarn add @theoryofnekomata/number-name |
|
|
|
``` |
|
|
|
|
|
|
|
### `npm run build` or `yarn build` |
|
|
|
## TODO |
|
|
|
|
|
|
|
Bundles the package to the `dist` folder. |
|
|
|
The package is optimized and bundled with Rollup into multiple formats (CommonJS, UMD, and ES Module). |
|
|
|
- [ ] Implement stream support |
|
|
|
- [ ] Implement `BigInt` support |
|
|
|
- [ ] Fully localizable number systems (e.g. custom rules for combining fragments of number words) |
|
|
|
- [ ] Optimizations for fractions. |
|
|
|
- [ ] Implement other `fractionType`s, (only `lazy` (digits) is supported as of 0.2.0, e.g. `0.05` => `zero point zero five`, |
|
|
|
will implement `ratio` (`zero and five over one hundred`) and `part` (`zero and five hundredths`)) |
|
|
|
- [ ] Upon adding more features, update the unit tests as well. |
|
|
|
|
|
|
|
<img src="https://user-images.githubusercontent.com/4060187/52168322-a98e5b00-26f6-11e9-8cf6-222d716b75ef.gif" width="600" /> |
|
|
|
Please star the repo if you find it useful in your projects. |
|
|
|
|
|
|
|
### `npm test` or `yarn test` |
|
|
|
## License |
|
|
|
|
|
|
|
Runs the test watcher (Jest) in an interactive mode. |
|
|
|
By default, runs tests related to files changed since the last commit. |
|
|
|
MIT. See [LICENSE file](./LICENSE) for details. |