Skip to main content

num2words-BD-INR

A Python package to convert numerical amounts to words with special handling for Indian Rupees (INR) and Bangladeshi Taka (BDT) with Numeric System Like Lakh, Crore. Useful for financial documents, invoices, and official reports where amounts need to be written out in words.

Features

  • 💰 Converts numerical amounts to words with proper currency formatting/numeric system(Lakh, Crore)
  • 🇧🇩🇮🇳 Special handling for Indian Rupees (INR) and Bangladeshi Taka (BDT)
  • 🌐 Supports various languages through the num2words library
  • 🛠️ Multiple formatting options:
    • Rounding amount values
    • Removing fractional parts
    • Title case or first letter capitalization
    • Custom prefixes and suffixes
    • Custom separators for integer parts

Installation

pip install num2words-BD-INR

Quick Start

from num2words_bd_inr import amount_in_words

# Basic usage
result = amount_in_words(1234.56, 'INR', 'en')
print(result)  # "One Thousand Two Hundred Thirty Four Rupees Fifty Six Paisa"

Examples

Different Currencies

# Indian Rupees
amount_in_words(1234.56, 'INR', 'en')  
# "One Thousand Two Hundred Thirty Four Rupees Fifty Six Paisa"

# Bangladeshi Taka
amount_in_words(1234.56, 'BDT', 'en')  
# "One Thousand Two Hundred Thirty Four Taka Fifty Six Paisa"

# US Dollars
amount_in_words(1234.56, 'USD', 'en')  
# "One Thousand Two Hundred Thirty Four Dollars Fifty Six Cents"

Formatting Options

# With rounding
amount_in_words(1234.56, 'BDT', 'en', rounding=True)
# "One Thousand Two Hundred Thirty Five Taka"

# Remove fractional part
amount_in_words(1234.56, 'EUR', 'en', rem_fraction=True)
# "One Thousand Two Hundred Thirty Four Euros"

# Custom text styling
amount_in_words(1000.00, 'USD', 'en', title_style=True, prefix_val="Only")
# "Only One Thousand Dollars"

# With capitalization of only first letter
amount_in_words(5432.10, 'GBP', 'en', cap_style=True)
# "Five thousand four hundred thirty two pounds ten pence"

# With custom integer separator
amount_in_words(1234.56, 'USD', 'en', int_sep=",")
# "One Thousand, Two Hundred Thirty Four Dollars Fifty Six Cents"

API Reference

amount_in_words()

amount_in_words(
    amount: float,
    currency: str,
    lang: str,
    rem_fraction: bool = False,
    rounding: bool = False,
    title_style: bool = False,
    cap_style: bool = False,
    prefix_val: Optional[str] = None,
    subfix_val: Optional[str] = None,
    int_sep: Optional[str] = None,
    decimal_sep: Optional[str] = None
) -> str

Parameters

Parameter Type Description Default
amount float The numerical amount to convert to words Required
currency str Currency code ('INR', 'BDT', or other standard currency codes) Required
lang str Language code for conversion (e.g., 'en', 'bn') Required
rem_fraction bool Whether to remove fractional parts False
rounding bool Whether to round the amount (takes precedence over rem_fraction) False
title_style bool Whether to apply title case to output False
cap_style bool Whether to capitalize first letter only False
prefix_val str Text to add before the amount words None
subfix_val str Text to add after the amount words None
int_sep str Separator for integer parts (e.g., 'and', ',') None
decimal_sep str Separator for decimal parts None

Return Value

A string containing the amount expressed in words according to the specified formatting options.

Important Notes

  • If both rounding and rem_fraction are set to True, rounding takes precedence.
  • The package correctly handles currency-specific terms (e.g., "Rupee"/"Paisa" for INR, "Taka"/"Paisa" for BDT).
  • Default text styling applies title case if no styling option is specified.

Requirements

  • Python 3.10 or above
  • num2words package

License

MIT License

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Issues and Feature Requests

If you find any bugs or have a feature request, please open an issue on the GitHub repository.

Release files for num2words-BD-INR 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for num2words-BD-INR 0.1.0
File Size Uploaded
num2words_bd_inr-0.1.0.tar.gz 7.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for num2words-BD-INR 0.1.0
File Interpreter ABI Platform
num2words_bd_inr-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.6 kB

Release files / num2words_bd_inr-0.1.0.tar.gz

Download URL num2words_bd_inr-0.1.0.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
012f29d4c486d89bd69d03ea505e95c0f52ba43b0a71eed28971c2eb065f3949
BLAKE2b-256 checksum
How to use checksums
971cc6f4231a70c7cbde4a01fee295e6c0dab25051da2ec902cb25be473c52fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Release files / num2words_bd_inr-0.1.0-py3-none-any.whl

Download URL num2words_bd_inr-0.1.0-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79c6f9068bee7dc018595a4f83c86b15aaccc3e650c5ea31b84ed3a5718485ad
BLAKE2b-256 checksum
How to use checksums
b86b8dd5440c750c1b8e58168aad6a91c4d5cdf84e38d4025cafc9321d1fe7b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page