A Python package to convert numbers to Nepali words
Project description
Nepali Number to Word Converter
A Python package that converts numbers to Nepali words and numerals.
Features
- Convert numbers to Nepali words (up to 99 खर्ब)
- Convert numbers to Nepali numerals with proper formatting (१,२३,४५६ /-)
- Support for positive and negative numbers
- Proper error handling for unsupported numbers
Installation
- Install the package:
pip install nepali_number_to_word
Usage
from nepali_number_to_word import NepaliNumberConverter
# Convert numbers to Nepali words (class method)
result = NepaliNumberConverter.convert_to_nepali_words(123456789)
print(result) # Output: बाह्र करोड चौतिस लाख छपन्न हजार सात सय उनान्नब्बे रूपैयाँ मात्र
# Convert numbers to Nepali numerals (static method)
result = NepaliNumberConverter.convert_to_nepali_numerals(123456789)
print(result) # Output: १२,३४,५६,७८९ /-
# Examples
print(NepaliNumberConverter.convert_to_nepali_words(123)) # एक सय तेइस रूपैयाँ मात्र
print(NepaliNumberConverter.convert_to_nepali_numerals(123)) # १२३ /-
# Error handling
try:
NepaliNumberConverter.convert_to_nepali_words(1000000000000000) # Raises ValueError
except ValueError as e:
print(e) # Numbers beyond 999,999,999,999,999 (99 खर्ब) are not supported
Number Units
The converter supports the following Nepali number units:
- खर्ब (Kharab) = 100,000,000,000
- अरब (Arab) = 1,000,000,000
- करोड (Crore) = 10,000,000
- लाख (Lakh) = 100,000
- हजार (Thousand) = 1,000
License
MIT License
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nepali_number_to_word-0.1.2.tar.gz.
File metadata
- Download URL: nepali_number_to_word-0.1.2.tar.gz
- Upload date:
- Size: 18.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1b359dc1a8a398557fdec46d50ce7e7e4498a3d851be3db0e0a96b6b7dd3c8c
|
|
| MD5 |
653c2b73cb86b455e9e86aed2a36b3e1
|
|
| BLAKE2b-256 |
afe2e5df7fe6e7c7cae48df12db5525fcbfc383a1d8603b769b900820a496251
|
File details
Details for the file nepali_number_to_word-0.1.2-py3-none-any.whl.
File metadata
- Download URL: nepali_number_to_word-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6cdd340cc33cf208e0d58c9f63168e6388c58542b3dc537bb4314b332ba71f7
|
|
| MD5 |
d0b9aa053a857dd62dd1a82d4a027a93
|
|
| BLAKE2b-256 |
5637171a3ba9debc326c91ba04bf903e97635f1fab9a073302756d014f99a502
|