https://github.com/zettca/ntoa
TypeScript Number to String
https://github.com/zettca/ntoa
deno typescript
Last synced: 4 months ago
JSON representation
TypeScript Number to String
- Host: GitHub
- URL: https://github.com/zettca/ntoa
- Owner: zettca
- License: mit
- Created: 2022-05-12T21:37:44.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-10-31T02:02:35.000Z (over 1 year ago)
- Last Synced: 2025-04-10T23:14:45.911Z (about 1 year ago)
- Topics: deno, typescript
- Language: TypeScript
- Homepage:
- Size: 144 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ntoa: _Number to String_ converter.
Wondering how to correctly pronounce
`659102863539127065129078569382156238956190238`?
No? Understandable, have a nice day.
But with `ntoa` you can do it - using the API, CLI, or WebApp.
> 659 Tredecillion 102 Duodecillion 863 Undecillion 539 Decillion 127 Nonillion
> 65 Octillion 129 Septillion 78 Sextillion 569 Quintillion 382 Quadrillion 156
> Trillion 238 Billion 956 Million 190 Thousand 238
Or if you're french 🇫🇷 or portuguese 🇵🇹 and use the awkward long scale, it's
(long version):
> Six Hundred Fifty Nine Septillion One Hundred Two Thousand Eight Hundred Sixty
> Three Sextillion Five Hundred Thirty Nine Thousand One Hundred Twenty Seven
> Quintillion Sixty Five Thousand One Hundred Twenty Nine Quadrillion Seventy
> Eight Thousand Five Hundred Sixty Nine Trillion Three Hundred Eighty Two
> Thousand One Hundred Fifty Six Billion Two Hundred Thirty Eight Thousand Nine
> Hundred Fifty Six Million One Hundred Ninety Thousand Two Hundred Thirty Eight
## Usage
### Web API 🌐 🦕
```ts
import { ntoa } from "https://esm.sh/gh/zettca/ntoa/mod.ts";
ntoa("123456789"); /// 123 million 456 thousand 789
ntoa("123456789123456789"); /// 123 Quadrillion 456 Trillion 789 Billion 123 Million 456 Thousand 780
```
### CLI
```sh
# install
deno install -f https://deno.land/x/ntoa/main.ts
# run
ntoa 123456789123456789123456789
# 123 Septillion 456 Sextillion 789 Quintillion 123 Quadrillion 456 Trillion 790 Billion
```