larzcurrency
Format and parse money for humans, per locale.
Locale-aware money display and parsing from a compact built-in table - no locale module or babel. Handles the details others miss: Indian lakh grouping, Swiss apostrophes, the German separator swap, symbol-after placement, correct minor-unit digits per currency, and parenthesised negatives.
larzscript pkg install currency
What you get
- Real per-locale formatting rules
- Indian lakh/crore grouping
- Correct minor-unit digits (JPY 0, BTC 8)
- Round-trips: parse(format(x)) == x
Try it
import "currency" as currency
print(currency.format(123456789, "USD"))
print(currency.format(123456789, "INR"))
print(currency.format(500, "JPY"))
print(currency.parse("$1,234,567.89", "USD"))Output
$1,234,567.89 โน12,34,567.89 ยฅ500 123456789
Why it's in the Larz Stack
larzcurrency is a real Larzscript package (larzscript pkg install currency) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.