https://github.com/jtpeller/num2words
Converts a number to its English counterpart. Uses arbitrary precision; so a number of any size can be converted.
https://github.com/jtpeller/num2words
arbitrary-precision english-numbers go golang num2words
Last synced: 12 months ago
JSON representation
Converts a number to its English counterpart. Uses arbitrary precision; so a number of any size can be converted.
- Host: GitHub
- URL: https://github.com/jtpeller/num2words
- Owner: jtpeller
- License: mit
- Created: 2021-12-13T04:38:31.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-11T01:49:05.000Z (over 1 year ago)
- Last Synced: 2025-06-02T08:35:18.828Z (about 1 year ago)
- Topics: arbitrary-precision, english-numbers, go, golang, num2words
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# num2words
[](https://pkg.go.dev/github.com/jtpeller/num2words)
[](https://goreportcard.com/report/github.com/jtpeller/num2words)
[](https://github.com/jtpeller/num2words/releases)

## Overview
Converts a number to its English counterpart.
## Usage
Installation can be achieved via:
```sh
go get -u github.com/jtpeller/num2words
```
Then, import it:
```go
import "github.com/jtpeller/num2words"
```
You can test the package by running the following command. It will give a short pass or fail result.
```sh
go test ./num2words_test
```
Alternatively, for a more verbose output, use:
```sh
go test ./num2words_test -v
```
It also wouldn't hurt to add a `-timeout 30` to prevent hanging on a test for too long.
## Contents
- `num2words_test`
- `num2words_test.go` -- holds all test functions for the package
- `bignum.go` -- holds needed wrappers for the big number package. Utilizes my repo at [gobig](https://github.com/jtpeller/gobig)
- `go.mod` -- manages the module
- `go.sum` -- manages any dependencies (which itself is managed by `go.mod`)
- `num2words.go` -- implementation for converting numbers to their word representation (e.g. 5 => five)
- `README.md` -- the file you're reading