# FORMAT

Rounds and formats a number with thousands separators and a fixed-length decimal part.

## Syntax

```sql
FORMAT ( expression, precision )

```

## Arguments

* expression: any valid numeric expression.
* precision: the number of digits after the decimal to pad or round to.

## Return Type

String. The thousands separator is hard-coded to “,” and the decimal separator is “.”

## Examples

```sql
SELECT FORMAT(1234.565, 2);

```

```output

+---------------------+
| FORMAT(1234.565, 2) |
+---------------------+
| 1,234.57            |
+---------------------+

```

```sql
SELECT FORMAT(1234.56499, 2);

```

```output

+------------------------+
| FORMAT(1234.561499, 2) |
+------------------------+
| 1,234.56               |
+------------------------+
```

```sql
SELECT FORMAT(1234.567, 0);

```

```output

+---------------------+
| FORMAT(1234.567, 0) |
+---------------------+
| 1,235               |
+---------------------+
```

***

Modified at: February 27, 2023

Source: [/db/v9.1/reference/sql-reference/string-functions/format/](https://docs.singlestore.com/db/v9.1/reference/sql-reference/string-functions/format/)

(An index of the documentation is available at /llms.txt)
