Skip to content

Extend Hindi (HI) number system to महागण (10^41)#662

Open
PtPrashantTripathi wants to merge 1 commit into
savoirfairelinux:masterfrom
PtPrashantTripathi:feat/hi-extend-number-scale-mahagan
Open

Extend Hindi (HI) number system to महागण (10^41)#662
PtPrashantTripathi wants to merge 1 commit into
savoirfairelinux:masterfrom
PtPrashantTripathi:feat/hi-extend-number-scale-mahagan

Conversation

@PtPrashantTripathi

@PtPrashantTripathi PtPrashantTripathi commented Jun 15, 2026

Copy link
Copy Markdown

Fixes # by extending the Hindi number scale

Changes proposed in this pull request:

  • Extended lang_HI.py high_numwords from खरब (10^11) all the way to
    महागण (10^41), covering the full classical Indian numbering system:
    नील, पद्म, शंख, महाशंख, अंत्या, महाअंत्या, मध्या, महामध्या,
    अशोहिणी, महा अशोहिणी, ओम, महाओम, गण, महागण
  • Fixed spelling of खरब (previously ख़रब had an erroneous nukta)
  • Updated tests/test_hi.py — corrected ख़रब → खरब in existing cases
    and added 18 new cardinal test cases, one per new unit

Status

  • READY
  • HOLD
  • WIP (Work-In-Progress)

How to verify this change

python -m pytest tests/test_hi.py -v

Or manually:

from num2words import num2words
num2words(10**41, lang='hi')   # → 'एक महागण'
num2words(10**17, lang='hi')   # → 'एक शंख'
num2words(10**13, lang='hi')   # → 'एक नील'
num2words(31415926535897932384626433832795028841971693, lang="hi") # → 'तीन सौ चौदह महागण एक हज़ार पाँच सौ बानवे गण पैंसठ महाओम पैंतीस ओम नवासी महा अशोहिणी उनासी अशोहिणी बत्तीस महामध्या अड़तीस मध्या छियालीस महाअंत्या छब्बीस अंत्या तैंतालीस महाशंख अड़तीस शंख बत्तीस पद्म उनासी नील पचास खरब अट्ठाईस अरब चौरासी करोड़ उन्नीस लाख इकहत्तर हज़ार छः सौ तिरानवे'

Additional notes

The Indian number system uses a 2-power grouping above हज़ार (10^3),
unlike the Western 3-power (million/billion) system. The names and
scale follow the Vedic tradition documented in:

Sources:

@PtPrashantTripathi

Copy link
Copy Markdown
Author

@savoirfairelinux dont you want to check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant