# pakdatakit 2.6.0

> Release notes for pakdatakit 2.6.0 (TypeScript, Python, Dart, .NET, PHP): what changed, what was fixed and how to upgrade.

Source: https://pakdatakit.dev/releases/2.6.0/

## TypeScript (npm)

[pakdatakit 2.6.0](https://www.npmjs.com/package/pakdatakit/v/2.6.0)

Minor release: one new feature. Every port gives the same results on the
shared test vectors (812 new ones).

### Added

- `parseAmount()` and `formatAmountInput()` (`pakdatakit/format`). `parseAmount`
  reads a rupee amount as people type it in Pakistan and returns
  `{ value, raw }` in rupees, rounded half-up to the paisa, or `null`. It
  accepts `150,000` and `1,50,000` grouping with decimals, Urdu and
  Arabic-Indic digits, `Rs`/`Rs.`/`PKR`/`₨` and a trailing `/-`, and the
  shorthand `k`, `thousand`, `hazar`, `ہزار`, `lakh`, `lac`, `لاکھ`, `crore`,
  `cr` and `کروڑ` (also `1.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, so `1.005` is 1.01
  in every language. `formatAmountInput` writes 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, and
  `IsPakAmount` for class-validator: passes when `parseAmount()` reads the
  value.

## Python (PyPI)

[pakdatakit 2.6.0](https://pypi.org/project/pakdatakit/2.6.0/)

Minor release: one new feature. Every port gives the same results on the
shared test vectors (812 new ones).

### Added

- `parse_amount()` and `format_amount_input()`, with the `ParsedAmount`
  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, or `null`. It
  accepts `150,000` and `1,50,000` grouping with decimals, Urdu and
  Arabic-Indic digits, `Rs`/`Rs.`/`PKR`/`₨` and a trailing `/-`, and the
  shorthand `k`, `thousand`, `hazar`, `ہزار`, `lakh`, `lac`, `لاکھ`, `crore`,
  `cr` and `کروڑ` (also `1.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, so `1.005` is 1.01
  in every language. `format_amount_input` writes the amount back
  (`"Rs. 150,000"`) for showing next to a field. It never throws.

## Dart (pub.dev)

[pakdatakit 2.6.0](https://pub.dev/packages/pakdatakit/versions/2.6.0)

Minor release: one new feature. Every port gives the same results on the
shared test vectors (812 new ones).

### Added

- `parseAmount()` and `formatAmountInput()` and the `ParsedAmount` class. `parseAmount`
  reads a rupee amount as people type it in Pakistan and returns
  `{ value, raw }` in rupees, rounded half-up to the paisa, or `null`. It
  accepts `150,000` and `1,50,000` grouping with decimals, Urdu and
  Arabic-Indic digits, `Rs`/`Rs.`/`PKR`/`₨` and a trailing `/-`, and the
  shorthand `k`, `thousand`, `hazar`, `ہزار`, `lakh`, `lac`, `لاکھ`, `crore`,
  `cr` and `کروڑ` (also `1.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, so `1.005` is 1.01
  in every language. `formatAmountInput` writes the amount back
  (`"Rs. 150,000"`) for showing next to a field. It never throws.

## .NET (NuGet)

[PakDataKit 2.6.0](https://www.nuget.org/packages/PakDataKit/2.6.0)

Minor release: one new feature. Every port gives the same results on the
shared test vectors (812 new ones).

### Added

- `Currency.ParseAmount()` and `Currency.FormatAmountInput()`, with the
  `ParsedAmount` record. `ParseAmount`
  reads a rupee amount as people type it in Pakistan and returns
  `{ value, raw }` in rupees, rounded half-up to the paisa, or `null`. It
  accepts `150,000` and `1,50,000` grouping with decimals, Urdu and
  Arabic-Indic digits, `Rs`/`Rs.`/`PKR`/`₨` and a trailing `/-`, and the
  shorthand `k`, `thousand`, `hazar`, `ہزار`, `lakh`, `lac`, `لاکھ`, `crore`,
  `cr` and `کروڑ` (also `1.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, so `1.005` is 1.01
  in every language. `FormatAmountInput` writes the amount back
  (`"Rs. 150,000"`) for showing next to a field. It never throws.
- `[PakAmount]` in `PakDataKit.DataAnnotations` and `IsPakAmount()` in
  `PakDataKit.FluentValidation`.

## PHP (Packagist)

[chmuzamil/pakdatakit 2.6.0](https://packagist.org/packages/chmuzamil/pakdatakit#v2.6.0)

Minor release: one new feature. Every port gives the same results on the
shared test vectors (812 new ones).

### Added

- `Currency::parseAmount()` and `Currency::formatAmountInput()`, with the
  `ParsedAmount` class. `parseAmount`
  reads a rupee amount as people type it in Pakistan and returns
  `{ value, raw }` in rupees, rounded half-up to the paisa, or `null`. It
  accepts `150,000` and `1,50,000` grouping with decimals, Urdu and
  Arabic-Indic digits, `Rs`/`Rs.`/`PKR`/`₨` and a trailing `/-`, and the
  shorthand `k`, `thousand`, `hazar`, `ہزار`, `lakh`, `lac`, `لاکھ`, `crore`,
  `cr` and `کروڑ` (also `1.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, so `1.005` is 1.01
  in every language. `formatAmountInput` writes the amount back
  (`"Rs. 150,000"`) for showing next to a field. It never throws.
- Laravel rule `pk_amount` (and `Rules\Amount`), with English and Urdu
  messages.
