Skip to main content

A Django app with filters to convert numbersinto Persian numbers or words.

Project description

Django Num2Fa

PyPI releases License

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-num2fa-1.0.3.tar.gz (15.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page