# splitInclusive

Source: https://pakdatakit.dev/api/typescript/salestax/functions/splitinclusive/

```ts
function splitInclusive(gross, rate): 
  | SalesTaxAmounts
  | null;
```

Defined in: [salestax.ts:183](https://github.com/chmuzamil/pakdatakit/blob/a6eeaa47381308c4e4fcda45b29642fe4fbfb1fc/src/salestax.ts#L183)

Splits an amount that includes sales tax into its value and tax.

The value is rounded half up to the paisa, and the tax is the rest, so
`net + tax` is always `gross`.

## Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `gross` | `number` | Amount including tax, 0 to 1 trillion rupees |
| `rate` | `number` | Percent, 0 to 100, at most 2 decimals |

## Returns

  \| [`SalesTaxAmounts`](https://pakdatakit.dev/api/typescript/salestax/interfaces/salestaxamounts/)
  \| `null`

The split, or `null` for an invalid amount or rate. Never throws.

## Example

```ts
splitInclusive(1180, 18); // { net: 1000, tax: 180, gross: 1180, rate: 18 }
```
