pakdatakit 2.6.0
TypeScript (npm)
Section titled “TypeScript (npm)”Minor release: one new feature. Every port gives the same results on the shared test vectors (812 new ones).
parseAmount()andformatAmountInput()(pakdatakit/format).parseAmountreads 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.formatAmountInputwrites the amount back ("Rs. 150,000") for showing next to a field. It never throws.pk.amount()in the Zod, Valibot, Yup, Joi and Superstruct adapters, andIsPakAmountfor class-validator: passes whenparseAmount()reads the value.
Python (PyPI)
Section titled “Python (PyPI)”Minor release: one new feature. Every port gives the same results on the shared test vectors (812 new ones).
parse_amount()andformat_amount_input(), with theParsedAmountdataclass.parse_amountreads 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.
Dart (pub.dev)
Section titled “Dart (pub.dev)”Minor release: one new feature. Every port gives the same results on the shared test vectors (812 new ones).
parseAmount()andformatAmountInput()and theParsedAmountclass.parseAmountreads 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.formatAmountInputwrites the amount back ("Rs. 150,000") for showing next to a field. It never throws.
.NET (NuGet)
Section titled “.NET (NuGet)”Minor release: one new feature. Every port gives the same results on the shared test vectors (812 new ones).
Currency.ParseAmount()andCurrency.FormatAmountInput(), with theParsedAmountrecord.ParseAmountreads 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.FormatAmountInputwrites the amount back ("Rs. 150,000") for showing next to a field. It never throws.[PakAmount]inPakDataKit.DataAnnotationsandIsPakAmount()inPakDataKit.FluentValidation.
PHP (Packagist)
Section titled “PHP (Packagist)”Minor release: one new feature. Every port gives the same results on the shared test vectors (812 new ones).
Currency::parseAmount()andCurrency::formatAmountInput(), with theParsedAmountclass.parseAmountreads 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.formatAmountInputwrites the amount back ("Rs. 150,000") for showing next to a field. It never throws.- Laravel rule
pk_amount(andRules\Amount), with English and Urdu messages.