[**@bondsports/general**](../README.md) • **Docs**

***

[@bondsports/general](../globals.md) / calculateUnitPriceFromTotal

# Function: ~~calculateUnitPriceFromTotal()~~

> **calculateUnitPriceFromTotal**(`totalPrice`, `isTaxInclusive`, `taxPercent`, `quantity`): `number`

Calculates the unit price based on the given total price, tax-inclusive status, tax percentage, and quantity.

## Parameters

• **totalPrice**: `number`

The total price.

• **isTaxInclusive**: `boolean`

A flag indicating whether the price includes tax.

• **taxPercent**: `number`

The tax percentage.

• **quantity**: `number` = `DEFAULT_QUANTITY`

The quantity of items (default: DEFAULT_QUANTITY).

## Returns

`number`

The calculated unit price.

## Deprecated

use the new calculateUnitPriceFromTotalWithTaxes

## Defined in

[utils/price.util.ts:314](https://github.com/Bond-Sports/bondUtils/blob/545f16ceb055481acfd7641d7809c0f252d3a5e6/packages/general/src/utils/price.util.ts#L314)
