---
cuppy_hub: salesforce
cuppy_path: reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/format-number.md
cuppy_section: docs
cuppy_doc: C67K-9NZZ
cuppy_doc_uuid: 8e2d9bfb-8edb-4a61-b8b1-648fba5538e5
cuppy_permalink: https://cuppy.io/salesforce/d/C67K-9NZZ
cuppy_version: 1
cuppy_updated: 2026-10-23T16:16:52.575Z
cuppy_canonical: https://cuppy.io/salesforce/docs/reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/format-number
cuppy_mcp: https://cuppy.io/mcp
cuppy_body_sha256: 840722402239f8933ae8d82a37326830f7ff1d05e36d3cbe9d5d73f9b21cf0eb
# cuppy_body_sha256 is over the document body ALONE, excluding both generated blocks.
---

> Mirror of <https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/format-number.html> (Salesforce, Data 360 Query Guide), read 2026-10-23. Salesforce's own page is the authority; this copy exists because that site refuses non-browser readers.

## `FORMAT_NUMBER`

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Converts a numeric value to a formatted string using a pattern syntax.

*   `<value>`: The numeric value to format. Accepts any numeric type.
*   `<pattern>`: A `varchar` format pattern that controls how the number is rendered.

Returns a `varchar` string representation of `<value>` formatted according to `<pattern>`.

Returns NULL if either argument is NULL.

The pattern syntax admits the following characters:

| Character | Meaning |
| --- | --- |
| `0` | Required digit position. Outputs `0` if no digit is present at that position. |
| `#` | Optional digit position. Outputs nothing if no digit is present at that position. |
| `.` | Decimal separator. |
| `,` | Grouping separator (thousands, and so on). Can define arbitrary group sizes. |
| `E` | Separates the mantissa and exponent in scientific notation (for example, `0.###E0`). |
| `%` | Multiplies the value by 100 and appends a percent sign. |
| `‰` | Multiplies the value by 1000 and appends a per mille sign. |
| `¤` | Currency sign. Always outputs `$` for a single `¤`, or `USD` for `¤¤`. Not locale-configurable. |
| `;` | Separates positive and negative subpatterns. |
| `-` | Minus sign. |
| `'` | Quotes literal text in the pattern. Use `''` to include a literal single quote. |

A pattern can contain two subpatterns separated by `;`:

If you don’t provide a negative subpattern, the negative pattern defaults to the positive pattern prefixed with `-`. When a negative subpattern is provided, only its prefix and suffix are used; the number formatting is always taken from the positive subpattern.

*   The pattern syntax is similar to [Java `DecimalFormat`](https://docs.oracle.com/en/java/se/17/docs/api/java.base/java/text/DecimalFormat.html) and [Unicode CLDR number patterns](https://cldr.unicode.org/translation/number-currency-formats/number-and-currency-patterns). Data 360 SQL supports only a subset of those standards — not all pattern features from those specifications are available.
*   Returns NULL if either `<value>` or `<pattern>` is NULL.
*   Use `#` in positions where you want to suppress leading or trailing zeros.
*   Use `0` in positions where you always want a digit displayed, even if it’s zero.

Pad a number to four digits with leading zeros.

Returns `'0042'`.

Format a number with two decimal places and thousands grouping.

Returns `'1,234,567.80'`.

Display a large integer with thousands separators.

Returns `'9,876,543'`.

Multiply by 100 and append a percent sign.

Returns `'75.3%'`.

Format a number in standard scientific notation.

Returns `'1.235E4'`.

Use parentheses to denote negative values (accounting style).

Returns `'(1,234.50)'`.

*   [TO_CHAR](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/to-char.html)
*   [Formatting Functions](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/formatting-func.html)


---
<!-- cuppy -->
You are reading one file. The same content is free over MCP at https://cuppy.io/mcp with no signup: ranked search across all 376 documents in this hub, the merged view when you work in a layer, known workarounds matched to the error you hit, and depth control so you spend tokens on what you need. Start with the `_hello` tool. How to connect: https://cuppy.io/salesforce/ Something wrong in this document? Report it with the `session feedback` tool on the same endpoint.
<!-- /cuppy -->
