https://github.com/iranian-github/django-num2fa
A set of Django template tags to convert numbers into Persian numbers or words
https://github.com/iranian-github/django-num2fa
django
Last synced: 8 months ago
JSON representation
A set of Django template tags to convert numbers into Persian numbers or words
- Host: GitHub
- URL: https://github.com/iranian-github/django-num2fa
- Owner: iranian-github
- License: agpl-3.0
- Created: 2024-01-01T14:18:48.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-01-01T15:28:11.000Z (about 2 years ago)
- Last Synced: 2025-06-04T10:03:23.194Z (10 months ago)
- Topics: django
- Language: Python
- Homepage:
- Size: 22.5 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: docs/Contributing.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Django Num2Fa
[](https://pypi.python.org/pypi/django-num2fa)
[](https://opensource.org/license/agpl-v3/)
`django-num2fa` is a wrapper around [num2fa](https://github.com/codewithemad/num2fa) package which provides a set of filters to convert numbers to Persian numbers and words.
## Installation
```bash
pip install -U django-num2fa
```
That's it!
## Usage
First, add `django_num2fa` inside your `INSTALLED_APPS`:
```python
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_num2fa',
# other packages
]
```
load `num2fa` inside your template:
```jinja
{% load num2fa %}
```
then, wherever you have a number in your code template, pipe it with one of the `fa_numbers`, `fa_words`, and `fa_ordinal_words` template filters.
```jinja
{% load num2fa %}
{{ number | fa_numbers }}
{{ number | fa_words }}
{{ number | fa_ordinal_words }}
```
## Contributing
We welcome contributions! To learn how you can contribute, please check the [Contributing](https://github.com/codewithemad/django-num2fa/blob/master/docs/Contributing.md) document.
## License
This work is licensed under the terms of the [GNU Affero General Public License (AGPL)](https://github.com/codewithemad/django-num2fa/blob/master/LICENSE.txt).