> For the complete documentation index, see [llms.txt](https://kb.craftformswp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kb.craftformswp.com/documentation/form-building/create-form/form-settings-post-context/price-formula.md).

# Price Formula

Implements price calculation functionality. It is the PRO version functionality.

[Field names are variables which can be used in the formula](/documentation/form-building/create-form/blocks.md#form-field-less-than-greater-than-variable). Also [smart variables](/documentation/form-building/create-form/form-settings-post-context/smart-variables.md) can be used in the formula. This should be a valid maths formula, define it here:

<figure><img src="https://97821998-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM2yV1foUgoGHBC66VBDw%2Fuploads%2F914TjNAfk4ZcjbahOoPw%2FSCR-20260521-orzr.png?alt=media&amp;token=70ec4a32-1e23-4b9d-8e89-3a6c15e41354" alt=""><figcaption></figcaption></figure>

The screenshot above features an example of price formula. I used "qty" variable (can be form field variable or smart variable), then I used multiplication operator "\*" and static numeric value "1.1".

### Maths operators

* `*` - multiplication
* `/` - division
* `-` - subtraction
* `+` - addition

### Functions

#### ceil(number, precision)

Rounds up number

#### floor(number, precision)

Rounds down number

#### round(number, precision = 0)

Rounds number

#### count(string)

Return numeric value of the string length

#### count\_nights(dateStart, dateEnd)

Example `count_nights(dates.checkin, dates.checkout)` - expect two arguments which are dates, returns number of nights between two dates provided

#### words\_count(string)

Example `words_count(message)` - expect one argument which is string, returns number of words in that string

#### min(number, ...number)

Returns lowest number

#### max(number, ...number)

Returns biggest number

#### is\_date\_between(date, dateRange)

Where `date` is target date and `dateRange` is start and end dates in format `date1:date2`

#### is\_time\_between(time, timeRange)

Where `time` is target time and `timeRange` is start and end times in format `time1:time2`

#### is\_empty(string)

#### is\_url(string)

#### is\_numeric(string)

#### is\_email(string)

#### is\_null(string)

#### is\_int(string)

#### is\_float(string)

#### lower(string)

Returns lowercased string

#### upper(string)

Returns uppercased string

#### includes(var, \[var1, var2, ...])

Returns `true` if var is in array of vars

#### sum(\[num1, num2, ...])

Returns sum of numbers in an array
