# ROUND_TO

The ROUND_TO function rounds a numeric value down to the nearest value from a specified list of fixed points.

## Syntax

`ROUND_TO(field, points)`

### Parameters

#### field

The numeric value to round. If the value is `null`, the function returns `null`.

#### points

A list of constant values that serve as the rounding points.

## Examples

Counts the number of employees, grouping them by their birth date rounded down to the nearest specified date window.

```esql
FROM employees
| STATS COUNT(*) BY birth_window=ROUND_TO(
    birth_date,
    "1900-01-01T00:00:00Z"::DATETIME,
    "1950-01-01T00:00:00Z"::DATETIME,
    "1955-01-01T00:00:00Z"::DATETIME,
    "1960-01-01T00:00:00Z"::DATETIME,
    "1965-01-01T00:00:00Z"::DATETIME,
    "1970-01-01T00:00:00Z"::DATETIME,
    "1975-01-01T00:00:00Z"::DATETIME
)
| SORT birth_window ASC
```
