Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/siyanew/num2fa
A Library to convert numbers to Farsi (Persian)
https://github.com/siyanew/num2fa
Last synced: 3 months ago
JSON representation
A Library to convert numbers to Farsi (Persian)
- Host: GitHub
- URL: https://github.com/siyanew/num2fa
- Owner: siyanew
- License: mit
- Created: 2023-07-17T05:57:05.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-17T09:10:39.000Z (over 1 year ago)
- Last Synced: 2024-06-28T04:33:48.932Z (5 months ago)
- Language: Go
- Size: 4.88 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-persian - Num2Fa - Convert Numbers to Farsi Words. (Go)
README
![Test](https://github.com/siyanew/num2fa/actions/workflows/test.yml/badge.svg)
[![Go Reference](https://pkg.go.dev/badge/github.com/siyanew/num2fa.svg)](https://pkg.go.dev/github.com/siyanew/num2fa)# Num2Fa - Number to Farsi Words
This is a Golang library that helps you convert numbers to Farsi(Persian) words.
## Installation
You can install this library using the `go get` command:```shell
go get github.com/siyanew/num2fa
```## Usage
To use the library, simply import it into your project and call the Num2fa function, passing in the number you want to convert as an argument. For example:
```go
import "github.com/siyanew/num2fa"func main() {
// Prints "سیصد هفتاد و شش"
fmt.Println(num2fa.Convert(376))// Prints "منفی یک میلیارد و دویست و سی و چهار میلیون و پانصد و شصت و هفت هزار و هشتصد و نود"
fmt.Println(num2fa.Convert(-1234567890))
}
```The function returns a string representing the Farsi words corresponding to the input number.
## License
This library is released under the MIT License. Please see the LICENSE file for more details.