from icu import RuleBasedNumberFormat, URBNFRuleSetTag, Locale
n = 111000
formatter = RuleBasedNumberFormat(URBNFRuleSetTag.SPELLOUT, Locale("hi"))
formatter.format(n) # 'एक लाख ग्यारह हज़ार'
formatter2 = RuleBasedNumberFormat(URBNFRuleSetTag.SPELLOUT, Locale("en_IN"))
formatter2.format(n) # lakh eleven thousand'
Created
February 27, 2022 06:54
-
-
Save andjc/b1188d33fb7790ee2c0e9e49fd2562ee to your computer and use it in GitHub Desktop.
Using PyICU to format and spellout numbers
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment