# Quantity

Using the **Quantity** element allows you to create any type of numbers as input.&#x20;

## **Element Tab**

The Quantity element has the following fields in the **Element Tab**:

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FEFW2ORbJZUOLLMvJ1OJn%2Fimage.png?alt=media&#x26;token=d64faee4-fc54-49c1-9b2c-eb12b2068ce2" alt=""><figcaption></figcaption></figure>

* **Name** - Title of the field.
* **Placeholder** - You can either fill the placeholder or not (It is not required).
* **Description** - Description of the field.
* **Step** - Defines the up and down (increase/decrease) buttons' step value.
* **Default Value** - The default value will be shown to the users when they open a cost calculator.
* **Min Value** - minimum value that the quantity field can take
* **Max Value** - maximum value that the quantity field can take
* **Unit Name** - You can put unit measures, such as kg(kilograms), gr(grams), m (meters), etc, to this field. You can also decide whether you want unit measures, for example, kg, to show on the right or left.
* **Hide Min/Max Values** - Enable to hide the minimum and maximum values set to the field in the calculator.&#x20;
* **Multiply by Unit Price** – enables the use of a unit price multiplier. When toggled on, the final value will be calculated by multiplying the selected value by the specified unit price.

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2F8R53qREpOMz7gpzckSxw%2Fimage.png?alt=media&#x26;token=3ffd8a24-b6fd-405e-81e5-b6780fdf939d" alt=""><figcaption></figcaption></figure>

* **Unit Price** – the cost per unit of the selected value. This numeric field supports decimal values and defines how much each unit contributes to the total.
* **Unit** – a label indicating the measurement unit used for the selected value (such as centimeters, meters, or inches).
* **Pricing Structure** - The **Pricing Structure** setting defines **how the Cost Calculator calculates the final value** of the field based on the quantity selected by the user. [**Learn More.**](#pricing-structure)

## Styles

Under this tab, you can select the suitable  style for the quantity field according to your needs:

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FBT4VNCZtIC20gJ64lOxx%2Fimage.png?alt=media&#x26;token=d172ac2f-2bed-4611-96f2-b3410d438680" alt=""><figcaption></figcaption></figure>

The field offers two styles: [**Default**](#default) and [**Side Buttons**](#side-buttons). With the **Side Buttons** style, you can choose the position of the buttons and display them separately, giving you greater control over the field’s appearance:

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2Fk6lMAmy7Rrj7vRzSNNku%2Fimage.png?alt=media&#x26;token=904ed98c-a333-4933-86d5-1d45770624e6" alt=""><figcaption></figcaption></figure>

Here are the available styles:

{% tabs %}
{% tab title="Default" %}

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2Fpku1t2mu0DHcNdM1M5Ur%2Fimage.png?alt=media&#x26;token=b9f57c43-3962-4b0b-828c-5905e5d20737" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Side Buttons" %}

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FA7vTQ6Pjwh4frg7DUVt1%2Fimage.png?alt=media&#x26;token=acd9ebfa-4487-4ecb-ada1-dcea11e941a6" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Side Buttons (both sides)" %}

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FFEnrPdhBUt08rMufqbrU%2Fimage.png?alt=media&#x26;token=1af0e3d5-2356-4f7a-9448-dd8ab978943f" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Side Buttons (separated)" %}

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FxVCRimc4U9gRlksPkf0i%2Fimage.png?alt=media&#x26;token=3590a0ed-bf9e-4b5e-8fd0-d9d91c538d8f" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Side Buttons (both separated)" %}

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FdiC1jhvstqdURMIqnBfI%2Fimage.png?alt=media&#x26;token=e1798b7a-a2c3-414b-bfe5-ccb3bb48aa3c" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## Settings Tab

The Quantity element has the following fields in the **Settings** Tab:

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FsrEoKfsl0QRZfQiDLnXq%2Fimage.png?alt=media&#x26;token=aeb850f9-7d6f-4cc0-92dd-36b88e28cc6e" alt=""><figcaption></figcaption></figure>

* **Currency Sign** - Enable if you want to show the currency sign in the total summary.
* **Currency Settings** - Applies global currency settings such as thousand and decimal. separators, the number of decimals to the entered value.
* **Round Value** - Enable if you want to round the value to the whole number in the total summary.
* **Required** - Defines whether the element will be required to be filled or not.
* **Hidden by Default** - The element will be hidden by default. You can make it visible using [**conditional system**](https://docs.stylemixthemes.com/cost-calculator-builder/conditional-system/condition-actions#id-1.-hidden-by-default).
* **Calculate hidden by default** - If any case hides the element: via the **Hidden by Default** setting or  hidden by some [**condition**](https://docs.stylemixthemes.com/cost-calculator-builder/conditional-system/condition-actions#id-2.-calculate-hidden-by-default), the element's default value (if it is set) will be counted in the formula.&#x20;
* **Show in Grand Total** - Disable if you want to hide the element in Grand Total.
* **Additional Classes** - Add extra classes to the HTML elements to further style changes

### Set Measurement Unit

This setting allows you to add a measuring unit (Ω, cm, kg, inch, etc.) to the field.

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2F9TFsrsFfYIWdZP9OtsXq%2Fimage.png?alt=media&#x26;token=89508cb6-1c6e-4b32-a2c5-c007daf50d45" alt=""><figcaption></figcaption></figure>

* **Unit Symbol** - enter the unit symbol&#x20;
* **Position** - select the position where the symbol should be displayed relative to the number
* **Thousands separator** - select the symbol to [separate thousands ](#user-content-fn-1)[^1]
* **Number of decimals** - indicate the number of decimals in the fractional part
* **Decimal separator** - select the symbol to separate the fractional part

Here is how it will look:&#x20;

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2Fd63ZTr2gZOKqjgBw8lL3%2Fimage.png?alt=media&#x26;token=188d0a1a-034a-41b7-b9db-d7d436ca8c8c" alt=""><figcaption><p>Sample of Measuring Unit</p></figcaption></figure>

## Pricing Structure

:star:**Premium Feature**

The **Pricing Structure** setting defines **how the Cost Calculator calculates the final value** of the field based on the quantity selected by the user. It allows you to override the field value before it is passed to the [formula ](https://docs.stylemixthemes.com/cost-calculator-builder/calculator-elements/total)field. This is especially useful for applying quantity-based discounts or custom pricing logic.

{% hint style="success" %}
Pricing structure is available in [**Quantity**](https://docs.stylemixthemes.com/cost-calculator-builder/calculator-elements/quantity) and [**Basic** **Slider**](https://docs.stylemixthemes.com/cost-calculator-builder/calculator-elements/range-button) Elements.
{% endhint %}

Pricing Structure has 4 different options:

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>Default</td><td><a href="#default-pricing">#default-pricing</a></td></tr><tr><td>All Units Pricing</td><td><a href="#all-units-pricing">#all-units-pricing</a></td></tr><tr><td>Tiered Pricing</td><td><a href="#tiered-pricing">#tiered-pricing</a></td></tr><tr><td>Flat Unit Price per Range</td><td><a href="#flat-unit-price-per-range">#flat-unit-price-per-range</a></td></tr></tbody></table>

By default, the calculator uses the [**Default** ](#default-pricing-structure)pricing structure. It just passes the entered value by the user to the formula field without changes.&#x20;

{% hint style="warning" %}
Pricing Structure is not available when the [**Multiply by Unit Price**](#settings-tab) setting is on.
{% endhint %}

When you select **All Units Pricing**, **Tiered Pricing**, or **Flat Unit Price per Range**, the calculator opens additional pricing settings, allowing you to configure pricing ranges and display a discount badge:

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FN0EehpXLmia1e5KKxAIX%2Fimage.png?alt=media&#x26;token=acc0b303-9fc5-40bf-bd77-343209bad67d" alt=""><figcaption></figcaption></figure>

Before looking at each pricing structure, let's understand the common settings of them:

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FWenyimlEjibXGwKfd9jU%2Fimage.png?alt=media&#x26;token=66fc2179-b411-447f-bd4b-310cdcca41ae" alt=""><figcaption></figcaption></figure>

* **Pricing Structure** - choose one of the available pricing structure options.
* **Pricing Range Table** - on this table, you can define the range and unit price for the inputs. The range always starts from the [minimum ](#element-tab)value of the element that you set, and ends with the [maximum ](#element-tab)value of the element. You can add new ranges by clicking the <kbd>Add another range</kbd> button, and delete the last range by clicking the <i class="fa-xmark-large">:xmark-large:</i> icon next to it.
* **Badge Text** - here you can define the label that will be displayed in the discount badge that will be displayed along with the field.
* **Format** - choose one of the available formats to display the discount badge on the element. There are three options:
  * % - displays the discounted amount in percentage
  * $ - displays the discounted amount in currency
  * $ + % - displays the discounted amount in currency and a percentage
* **Variants** - choose the discounted badge style

Here you can see the different badges and how they look with sample examples:

{% tabs %}
{% tab title=" % and  Outlined" %}

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FrwNn3D865Zk353g9GO3q%2Fimage.png?alt=media&#x26;token=9a7d4e33-6ef0-4819-8235-727351c45d1d" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="$ and Primary" %}

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2Fto7qLh7bakFsotWmlWwB%2Fimage.png?alt=media&#x26;token=51a911bc-0cc3-4eda-98be-e153c0f02029" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="$ + % and Solid " %}

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FjfSes6gIxvnw1YSPeZU6%2Fimage.png?alt=media&#x26;token=43e40710-4728-4a6c-a517-623c33726bea" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

Before going deep to learn about each structure, here is a quick summary of them:

<details>

<summary>Pricing Range used in the table examples</summary>

* From 0 to 10 with a unit price of 17
* From 11 to 100 with a unit price of 14
* From 101 to 200 with a unit price of 12
* From 201 to 250 with a unit price of 10

</details>

| Pricing Structure                                           | Explanation                                                             | Input: 8     | Input: 57               | Input: 221                                    |
| ----------------------------------------------------------- | ----------------------------------------------------------------------- | ------------ | ----------------------- | --------------------------------------------- |
| [**Default Pricing**](#default-pricing)                     | Passes the entered value directly to the formula without modification   | 8            | 57                      | 221                                           |
| [**All Units Pricing**](#all-units-pricing)                 | Applies one unit price to all units based on the matched quantity range | 8 × 17 = 136 | 57 × 14 = 798           | 221 × 10 = 2210                               |
| [**Tiered Pricing**](#tiered-pricing)                       | Calculates each pricing range separately and sums the results           | 8 × 17 = 136 | 10 × 17 + 47 × 14 = 828 | 10 × 17 + 90 × 14 + 100 × 12 + 21 × 10 = 2840 |
| [**Flat Unit Price per Range**](#flat-unit-price-per-range) | Returns a fixed price based on the matched quantity range               | 17           | 14                      | 10                                            |

### Default Pricing

This is the default behavior of the Cost Calculator. The value entered by the user is passed directly to the formula field without any modification.

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FuDNUkR3eSbVMooB7s6Tu%2Fimage.png?alt=media&#x26;token=1c69c4af-00cd-4219-8f89-66e9463c0446" alt=""><figcaption></figcaption></figure>

#### Example

If the user enters 25, the formula receives 25.

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FzFUtlF0Mq18EFQPGa41i%2Fimage.png?alt=media&#x26;token=8cd8b5cd-6c69-4fcc-9fc2-5db74a2882f3" alt=""><figcaption></figcaption></figure>

Use Default Pricing when no quantity-based pricing logic is required, and calculations are handled entirely inside the formula.

### All Units Pricing

This option applies a single unit price to all selected units within a range. You define quantity ranges and assign a unit price for each range. Once a range is matched, all units are multiplied by the unit price of that range.

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FNon06QRhKmiaPa0biWET%2Fimage.png?alt=media&#x26;token=2181e948-6f7f-44d7-adb7-c70cad7fa8cf" alt=""><figcaption></figcaption></figure>

#### Example

Let's set the pricing range like that:

* From 0 to 10 with a unit price of 17
* From 11 to 100 with a unit price of 14
* From 101 to 200 with a unit price of 12
* Rest, from 201 to 250 with a unit price of 10

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FzV0RxRYey0T4HEBSuCFD%2Fimage.png?alt=media&#x26;token=c078b3f1-616b-455a-a510-a090aa81cd44" alt=""><figcaption></figcaption></figure>

Here are the results. Switch tabs to check the difference:

{% tabs %}
{% tab title="Input 8" %}
User enters **8.** It matches the **first** range.\
Final value is **8 × 17 = 136**

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FxcWSnLhZnOYOOxW91vXX%2Fimage.png?alt=media&#x26;token=eae58ce7-9884-4607-875e-86dc05925b78" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Input 57" %}
User enters **57.** It matches the **second** range.\
Final value is **57× 14 = 798**

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2Ff31f8JSNxDMbVVurTjMm%2Fimage.png?alt=media&#x26;token=1caab1f6-8aec-4fc7-939a-2df0ee39efe6" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Input 221" %}
User enters **221.** It matches the **last** range.\
Final value is **221 × 10 = 2210**

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FRAgHLaN8LcSK9SmDpxw0%2Fimage.png?alt=media&#x26;token=aa7a7e9b-5b3e-446e-883c-94fb23b3546a" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

{% hint style="success" %}
Use this option when you want bulk discounts where all units get the same price once a quantity threshold is reached.
{% endhint %}

### Tiered Pricing

This option applies different prices to different portions of the quantity. Each range has its own unit price and is calculated independently. The final value is the sum of all tier calculations.

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FeZN3KlEyFOau7FKQQxM4%2Fimage.png?alt=media&#x26;token=bdf98f27-1cd0-4080-a921-63dffaf196ef" alt=""><figcaption></figcaption></figure>

#### Example

Let's set the pricing range like that:

* From 0 to 10 with a unit price of 17
* From 11 to 100 with a unit price of 14
* From 101 to 200 with a unit price of 12
* Rest, from 201 to 250 with a unit price of 10

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FCRrcn8mB7WNzJ6lrSdjO%2Fimage.png?alt=media&#x26;token=d0c8e1d3-5a6b-438f-adc1-ead2130c0794" alt=""><figcaption></figcaption></figure>

Here are the results. Switch tabs to check the difference:

{% tabs %}
{% tab title="Input 8" %}
User enters **8.** All units fall into the first range:\
Final value is **8 × 17 = 136**

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FxcWSnLhZnOYOOxW91vXX%2Fimage.png?alt=media&#x26;token=eae58ce7-9884-4607-875e-86dc05925b78" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Input 57" %}
User enters **57**.&#x20;

* First 10 units → 10 × 17 = 170
* Next 47 units → 47 × 14 = 658

Final value is **170 + 658 = 828**

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FeeOUcNjv0MoV6eLq80JK%2Fimage.png?alt=media&#x26;token=2f0e71b6-cd5c-434e-bd8b-c18be5dd1d38" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Input 221" %}
User enters **221**

* First 10 units → 10 × 17 = 170
* Next 90 units → 90 × 14 = 1260
* Next 100 units → 100 × 12 = 1200
* Remaining 21 units → 21 × 10 = 210

Final value is the sum of all: **2840.**

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2Fn3X0zrDanu5TsjlxVHsY%2Fimage.png?alt=media&#x26;token=8ea353ba-128b-47bc-8cfc-10e46034d148" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

{% hint style="success" %}
Use Tiered Pricing when pricing must gradually decrease as quantity increases rather than switching all units to a lower price.
{% endhint %}

### Flat Unit Price per Range

This option assigns a fixed value when the entered quantity falls within a specific range. Instead of multiplying units, the calculator returns a predefined flat value for the matched range.

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FV7SXpaOHQuqPUKYf5Zjz%2Fimage.png?alt=media&#x26;token=c4a9dd0c-e440-4103-90d7-b9f953194ceb" alt=""><figcaption></figcaption></figure>

#### Example

Let's set the pricing range like that:

* From 0 to 10 with a unit price of 17
* From 11 to 100 with a unit price of 14
* From 101 to 200 with a unit price of 12
* Rest, from 201 to 250 with a unit price of 10

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FKjdh4CCiKtbNfb1OVJmV%2Fimage.png?alt=media&#x26;token=24eec5fd-3ff0-4f5f-a533-9ba41d6f29b1" alt=""><figcaption></figcaption></figure>

Here are the results. Switch tabs to check the difference:

{% tabs %}
{% tab title="Input 8" %}
User enters **8.** All units fall into the first range:\
Final value is **17.**

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FfpUfNxtYwx1lecEK1HAh%2Fimage.png?alt=media&#x26;token=8a68b6a0-9b05-4af6-a69e-7c392d0abf1e" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Input 57" %}
User enters **57**. Matched range is 11 to 100:\
Final value is **14.**

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FeVhI08PBmTtYOOVdbB4j%2Fimage.png?alt=media&#x26;token=5a7e314f-d636-44bc-92b2-25d6fc04be23" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Input 221" %}
User enters **221.** Matched range is 201 to 25:\
Final value is **10.**

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FSmdjL2vOP4LTPIYl7qEP%2Fimage.png?alt=media&#x26;token=d8f3d7d7-f4a4-4179-a87e-00142f2a73e0" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

{% hint style="success" %}
Use this option when pricing is not dependent on unit count and only the selected range matters.
{% endhint %}

## Fractional (Decimal) Value Input

When using the Quantity field with its default settings, it is not possible to input fractional numbers. Any fractional number entered will automatically be rounded to the nearest whole number:

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2F5zlsCE68Ci2KfmAYtILY%2FCalculators%20%E2%80%B9%20StyleMix%20%E2%80%94%20WordPress.gif?alt=media&#x26;token=e6b62740-00e6-4eb8-815c-3a66965fc7c8" alt=""><figcaption><p>Quantity Field (Currncy Settings, Round Value are OFF)</p></figcaption></figure>

### Enabling Fractional Input

To allow the input of fractional numbers in the Quantity field, the **Currency Settings** must be enabled. This setting ensures that the Quantity field can handle and correctly display fractional values.

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FCrDXuUChbVM0lrzzQZfN%2Fimage.png?alt=media&#x26;token=3d57133a-31aa-4a41-9b53-ca924957a724" alt=""><figcaption><p>Currency Settings in the Quanttiy Field Settings</p></figcaption></figure>

**Here is the result:**

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FxA4VCdXEUYPr42JU0Sce%2FCalculators%20%E2%80%B9%20StyleMix%20%E2%80%94%20WordPress%20(1).gif?alt=media&#x26;token=07f418da-570f-49d9-9bf7-58cd0c99dd72" alt=""><figcaption><p>Quantity Field (Currency Settings is ON, Round Value is OFF)</p></figcaption></figure>

{% hint style="success" %}
If both **Currency Settings** and **Round Value** options are enabled, you can enter fractional values in the Quantity field. However, these values will be automatically rounded to the nearest whole number in the summary.
{% endhint %}

## **Example of Using Quantity Element**

Let’s create a BMI Calculator with a quantity element.&#x20;

The default height value will be 170 with a unit value in cm. The default weight value will be 60 with a unit value in kg. There will be a formula element to calculate the BMI.

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FUpN5CiH6LZ1nyGK0sXcg%2Fimage.png?alt=media&#x26;token=fe0ec420-1ee7-4a9a-8808-5b92f1cd3681" alt=""><figcaption></figcaption></figure>

Choose the correct styles for the fields:

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FemjWAYwloK83ljZGJSvE%2Fimage.png?alt=media&#x26;token=b9280e69-346c-498f-af73-22dcca5fbabc" alt=""><figcaption></figcaption></figure>

That’s how it will look on the user’s page:

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FknmSaj6au6BKAd53y0HK%2Fimage.png?alt=media&#x26;token=290b59e3-964e-41bf-b072-920c1bf275da" alt=""><figcaption></figcaption></figure>

You can set up **Multiply by Unit Price** when you want the value a user inputs to multiply by the cost. For example, if the cargo service delivers packages from the USA to Europe at 25 USD/ kg. The values will multiply by 25 to calculate the fees for the delivery.

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FNvhCRXto6SUhglplKc4m%2Fimage.png?alt=media&#x26;token=d128970a-d9a5-4ef1-91c1-ed90630ece9b" alt=""><figcaption></figcaption></figure>

That's how it will look on the user's page

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FNfE4iYpi8SUyqQ014TsD%2Fimage.png?alt=media&#x26;token=424d8804-dc49-4717-8751-77407dffede4" alt=""><figcaption></figcaption></figure>

[^1]: r.g 7, 000, 000 (seven millions)
