# FORMAT\_NUMBER

### Description

`FORMAT_NUMBER` formats a number as a string with a configurable number of decimal places, decimal separator, and thousands separator. Useful for displaying monetary amounts or other numeric values in a locale-appropriate or house-style format.

### Syntax

```
FORMAT_NUMBER(number, decimal_places?, decimal_sep?, thousands_sep?)
```

**Returns:** A formatted string representation of the number.

### Example

```
FORMAT_NUMBER(1234567.891)
```

This returns `'1,234,567.89'`.

### Example with custom separators

```
FORMAT_NUMBER(1234567.891, 2, ',', '.')
```

This returns `'1.234.567,89'` — useful for European locale formatting.

### Example in context

```
p is Person
FORMAT_NUMBER(p.total_assets, 2, '.', "'")
```

Returns the total assets formatted as e.g. `"1'234'567.89"` for Swiss-style display.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.atfinity.io/rule-language/operators/string-operators/format_number.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
