diff --git a/README.md b/README.md index 5fddcee..d169fbb 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,62 @@ # NumToWordsGo -A lightweight and efficient Go library that provides a simple function to convert numeric values into their corresponding word representation. + + +[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) + +NumToWordsGo is a lightweight and efficient Go library that provides a simple function to convert numeric values into their corresponding word representation. With this library, you can easily convert numbers to words, making it useful for applications that require human-readable number formatting or text generation. + +## Features + +- Convert numbers to their word representation +- Supports numbers up to billions +- Efficient and easy-to-use + +## Installation + +To use NumToWordsGo in your Go project, you need to install it using `go get` command: + +```bash +go get github.com/yousifnimah/NumToWordsGo +``` + + +## Usage + +Here's an example of how to use NumToWordsGo in your Go code: + +```go +package main + +import ( + "fmt" + "github.com/yousifnimah/NumToWordsGo/NumToWords" +) + +func main() { + input := 123456789 + words, err := NumToWords.Convert(input, "en") + if err != nil { + return + } + fmt.Println(words) +} +``` + +Output: +```go +one hundred twenty three million four hundred fifty six thousand seven hundred eighty nine +``` + +In the example above, we import the NumToWordsGo package and use the NumToWords function to convert the number 123456789 into its word representation. The result is then printed to the console. + + +## License +This project is licensed under the MIT License. See the LICENSE file for details. + +## Contributing +Contributions are welcome! If you find any issues or want to add new features or improvements, please create a pull request. + +## Acknowledgments +This library is inspired by the need for number-to-word conversion in various applications. +Contact +For any questions or inquiries, please feel free to contact me. \ No newline at end of file diff --git a/_example/main.go b/_example/main.go index 428b344..8aec701 100644 --- a/_example/main.go +++ b/_example/main.go @@ -6,7 +6,7 @@ import ( ) func main() { - input := 50021 + input := 123456789 words, err := NumToWords.Convert(input, "en") if err != nil { return