Repository navigation
PakDataKit for .NET 2.6.0
PakDataKit for .NET 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
Currency.ParseAmount()andCurrency.FormatAmountInput(), with the
ParsedAmountrecord.ParseAmount
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.FormatAmountInputwrites the amount back
("Rs. 150,000") for showing next to a field. It never throws.[PakAmount]inPakDataKit.DataAnnotationsandIsPakAmount()in
PakDataKit.FluentValidation.