A Django app with filters to convert numbersinto Persian numbers or words.
Project description
Django Num2Fa
django-num2fa
is a wrapper around num2fa package which provides a set of filters to convert numbers to Persian numbers and words.
Installation
pip install -U django-num2fa
That's it!
Usage
First, add django_num2fa
inside your INSTALLED_APPS
:
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:
{% 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.
{% 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 document.
License
This work is licensed under the terms of the GNU Affero General Public License (AGPL).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-num2fa-1.0.3.tar.gz
.
File metadata
- Download URL: django-num2fa-1.0.3.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 614a1f700e0787a0a80593d422705f1fe3f4785f1b3e94606a0cd534e37f64d6 |
|
MD5 | e541e8f9710ffff376835b34bc1add0f |
|
BLAKE2b-256 | 15853b3f99ef37b5bf2feb205dac30ace21b993f990cd07e4f4b44d499a365e2 |