Repository navigation
pakdatakit for Python 2.6.0
pakdatakit for Python 2.6.0 · Package · Docs · Playground
Minor release: one new feature. Every port gives the same results on the
shared test vectors (812 new ones).
Added
parse_amount()andformat_amount_input(), with theParsedAmount
dataclass.parse_amount
reads a rupee amount as people type it in Pakistan and returns
{ value, raw }in rupees, rounded half-up to the paisa, ornull. It
accepts150,000and1,50,000grouping with decimals, Urdu and
Arabic-Indic digits,Rs/Rs./PKR/₨and a trailing/-, and the
shorthandk,thousand,hazar,ہزار,lakh,lac,لاکھ,crore,
crandکروڑ(also1.5 lakh,2.25cr). It rejects negatives, ranges,
more than one number, leftover letters, ambiguous grouping and amounts over
Rs. 50 trillion. The arithmetic is done on the digits, so1.005is 1.01
in every language.format_amount_inputwrites the amount back
("Rs. 150,000") for showing next to a field. It never throws.