---
schema_version: "1"
id: 208db01c5651f098caf02b418d24e912ae8d1d742eff6d496f2b2c76f148c93d
title: Omnistudio Mathematical Functions
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_omnistudio_mathematical_functions.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_mathematical_functions.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: db9d2b4644ed68f36a5783d42708a707325588864aaa65b9875e3577b923380b
description: Functions that operate on numbers.
products:
  - Omnistudio
release: "264"
---
# Omnistudio Mathematical Functions

Functions that operate on numbers.

- **[Omnistudio ABS Function](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_mathematical_functions.htm&release=264.0.0&type=5)**  
    Returns the absolute value of a numeric expression.
- **[Omnistudio ROUND function](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_mathematical_functions.htm&release=264.0.0&type=5)**  
    Rounds a numeric expression up or down to a specified level of precision.
- **[Omnistudio SQRT Function](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_mathematical_functions.htm&release=264.0.0&type=5)**  
    Returns the square root of a numeric expression.

## Omnistudio ABS Function

Returns the absolute value of a numeric expression.

### Signature

`ABS(expression)`

### Return Value

Number

### Parameters

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col style="width:16.666666666666664%">
              <col style="width:16.666666666666664%">
              <col style="width:16.666666666666664%">
              <col style="width:50%">
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d25559e123">
                  <p style="margin-bottom:0;">Parameter</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d25559e129">
                  <p style="margin-bottom:0;">Data Type</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d25559e135">
                  <p style="margin-bottom:0;">Necessity</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d25559e141">
                  <p style="margin-bottom:0;">Description</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Parameter" class="slds-cell-wrap" style="vertical-align:top;" headers="d25559e123 ">
                  <p style="margin-bottom:0;"><code><var>expression</var></code></p>
                </td>

                <td data-label="Data Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d25559e129 ">
                  <p style="margin-bottom:0;">Number</p>
                </td>

                <td data-label="Necessity" class="slds-cell-wrap" style="vertical-align:top;" headers="d25559e135 ">
                  <p style="margin-bottom:0;">Required</p>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d25559e141 ">
                  <p style="margin-bottom:0;">An expression that resolves to the number for which the absolute value is to be returned.</p>
                </td>

              </tr>
            </tbody>
          </table>

![Positive Expression Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Positive Expression Example

Formula: `ABS(4)`

Return value: `4`

![Negative Expression Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Negative Expression Example

Formula: `ABS(-4.50)`

Return value: `4.5`

![Negative Expression Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Negative Expression Example

Formula: `ABS(2 - (2 * 3))`

Return value: `4`

## Omnistudio ROUND function

Rounds a numeric expression up or down to a specified level of precision.

### Signature

`ROUND(expression, precision, direction)`

### Return Value

Number

### Parameters

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col style="width:16.666666666666664%">
              <col style="width:16.666666666666664%">
              <col style="width:16.666666666666664%">
              <col style="width:50%">
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d25559e299">
                  <p style="margin-bottom:0;">Parameter</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d25559e305">
                  <p style="margin-bottom:0;">Data Type</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d25559e311">
                  <p style="margin-bottom:0;">Necessity</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d25559e317">
                  <p style="margin-bottom:0;">Description</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Parameter" class="slds-cell-wrap" style="vertical-align:top;" headers="d25559e299 ">
                  <p style="margin-bottom:0;"><code><var>expression</var></code></p>
                </td>

                <td data-label="Data Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d25559e305 ">
                  <p style="margin-bottom:0;">Number</p>
                </td>

                <td data-label="Necessity" class="slds-cell-wrap" style="vertical-align:top;" headers="d25559e311 ">
                  <p style="margin-bottom:0;">Required</p>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d25559e317 ">
                  <p style="margin-bottom:0;">An expression that resolves to the number to be rounded.</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Parameter" class="slds-cell-wrap" style="vertical-align:top;" headers="d25559e299 ">
                  <p style="margin-bottom:0;"><code><var>precision</var></code></p>
                </td>

                <td data-label="Data Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d25559e305 ">
                  <p style="margin-bottom:0;">Integer</p>
                </td>

                <td data-label="Necessity" class="slds-cell-wrap" style="vertical-align:top;" headers="d25559e311 ">
                  <p style="margin-bottom:0;">Optional</p>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d25559e317 ">
                  <p>A non-negative integer that indicates the number of decimal places to which to round
                    the result. Specify <code>0</code> to return an integer. Specify a positive integer
                    to round to that number of decimal places. Do not specify a negative number or a decimal
                    value.</p>
                  <p style="margin-bottom:0;">If the number has fewer decimal places than the specified precision, the function
                    returns only the lower number of decimal places. Specify a precision of 0 to return
                    an integer. By default, the function rounds the result to two decimal places of
                    precision.</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Parameter" class="slds-cell-wrap" style="vertical-align:top;" headers="d25559e299 ">
                  <p style="margin-bottom:0;"><code><var>direction</var></code></p>
                </td>

                <td data-label="Data Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d25559e305 ">
                  <p style="margin-bottom:0;">Constant</p>
                </td>

                <td data-label="Necessity" class="slds-cell-wrap" style="vertical-align:top;" headers="d25559e311 ">
                  <p style="margin-bottom:0;">Optional</p>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d25559e317 ">
                  <p>A constant that indicates the direction in which to round the result:</p>
                  <ul>
                    <li>
                      <p>
                        <code>CEILING</code> rounds the least significant digit of the result up.
                      </p>
                    </li>

                    <li>
                      <p>
                        <code>DOWN</code> rounds the least significant digit of the result down.
                        The digit remains unchanged regardless of the digit to its right.
                      </p>
                    </li>

                    <li>
                      <p>
                        <code>FLOOR</code> rounds the least significant digit of the result down.
                      </p>
                    </li>

                    <li>
                      <p>
                        <code>HALF_DOWN</code> rounds the least significant digit of the result down
                        if the digit to its right is less than or equal to 5.
                      </p>
                    </li>

                    <li>
                      <p>
                        <code>HALF_EVEN</code> rounds the least significant digit of the result up or
                        down to the nearest even digit if the digital to its right is equal to 5.
                      </p>
                    </li>

                    <li>
                      <p>
                        <code>HALF_UP</code> rounds the least significant digit of the result up if
                        the digit to its right is greater than or equal to 5.
                      </p>
                    </li>

                    <li>
                      <p>
                        <code>UP</code> rounds the least significant digit of the result up.
                        The digit increases by one regardless of the digit to its right.
                      </p>
                    </li>

                  </ul>
                  <p style="margin-bottom:0;">By default, the function rounds up or down based on the digit to the right of
                    the least significant digit of the result (to the right of the specified level
                    of precision). If you specify a <var>direction</var>, you must also
                    specify a <var>precision</var>.</p>
                </td>

              </tr>
            </tbody>
          </table>

![Round with No Precision and No Direction Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Round with No Precision and No Direction Example

Formula: `ROUND(4.115)`

Return value: `4.12`

![Round with Precision 0 and No Direction Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Round with Precision 0 and No Direction Example

Formula: `ROUND(4.115, 0)`

Return value: `4`

![Round with Precision 2 and Direction DOWN Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Round with Precision 2 and Direction DOWN Example

Formula: `ROUND(2.119, 2, DOWN)`

Return value: `2.11`

![Round with Precision 2 and Direction UP Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Round with Precision 2 and Direction UP Example

Formula: `ROUND(2.111, 2, UP)`

Return value: `2.12`

![Round with Precision 1 and Direction FLOOR Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Round with Precision 1 and Direction FLOOR Example

Formula: `ROUND(2.55, 1, FLOOR)`

Return value: `2.5`

![Round with Precision 1 and Direction CEILING Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Round with Precision 1 and Direction CEILING Example

Formula: `ROUND(2.55, 1, CEILING)`

Return value: `2.6`

![Round with Precision 0 and Direction FLOOR Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Round with Precision 0 and Direction FLOOR Example

Formula: `ROUND(2.5, 0, FLOOR)`

Return value: `2`

![Round with Precision 0 and Direction CEILING Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Round with Precision 0 and Direction CEILING Example

Formula: `ROUND(2.5, 0, CEILING)`

Return value: `3`

![Round with Precision 2 and Direction HALF\_DOWN Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Round with Precision 2 and Direction HALF\_DOWN Example

Formula: `ROUND(2.575, 2, HALF_DOWN)`

Return value: `2.57`

![Round with Precision 2 and Direction HALF\_UP Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Round with Precision 2 and Direction HALF\_UP Example

Formula: `ROUND(2.575, 2, HALF_UP)`

Return value: `2.58`

![Round with Precision 2 and Direction HALF\_EVEN Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Round with Precision 2 and Direction HALF\_EVEN Example

Formula: `ROUND(2.225, 2, HALF_EVEN)`

Return value: `2.22`

## Omnistudio SQRT Function

Returns the square root of a numeric expression.

### Signature

`SQRT(expression)`

### Return Value

Number

### Parameters

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col style="width:16.666666666666664%">
              <col style="width:16.666666666666664%">
              <col style="width:16.666666666666664%">
              <col style="width:50%">
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d25559e731">
                  <p style="margin-bottom:0;">Parameter</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d25559e737">
                  <p style="margin-bottom:0;">Data Type</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d25559e743">
                  <p style="margin-bottom:0;">Necessity</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d25559e749">
                  <p style="margin-bottom:0;">Description</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Parameter" class="slds-cell-wrap" style="vertical-align:top;" headers="d25559e731 ">
                  <p style="margin-bottom:0;"><code><var>expression</var></code></p>
                </td>

                <td data-label="Data Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d25559e737 ">
                  <p style="margin-bottom:0;">Number</p>
                </td>

                <td data-label="Necessity" class="slds-cell-wrap" style="vertical-align:top;" headers="d25559e743 ">
                  <p style="margin-bottom:0;">Required</p>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d25559e749 ">
                  <p style="margin-bottom:0;">An expression that resolves to the non-negative number for which the square root is to be returned.</p>
                </td>

              </tr>
            </tbody>
          </table>

![Positive Integer Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Positive Integer Example

Formula: `SQRT(3 * 12)`

Return value: `6`

![Positive Decimal Number Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Positive Decimal Number Example

Formula: `SQRT(2.5)`

Return value: `1.5811388300841898`

![Negative Integer Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_example.png)

Negative Integer Example

Formula: `SQRT(-4)`

Return value: `{}`