https://github.com/siyanew/num2fa
A Library to convert numbers to Farsi (Persian)
https://github.com/siyanew/num2fa
Last synced: about 1 month 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 (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-17T09:10:39.000Z (almost 2 years ago)
- Last Synced: 2024-11-17T16:43:03.387Z (7 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

[](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.