---
title: printf function
description: Learn the syntax of the printf function of the SQL language in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/functions/printf
---

# `printf` function

**Applies to:** ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks SQL ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks Runtime

Returns a formatted string from printf-style format strings.

The function exploits the `java.util.Formatter` class with `Locale.US`.
For details, see [java.util.Formatter](https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html).

## Syntax

```
printf(strfmt[, obj1, ...])
```

## Arguments

* `strfmt`: A `STRING` expression.
* `objN`: A `STRING` or numeric expression.

## Returns

A `STRING`.

## Examples

```sql
> SELECT printf('Hello World %d %s', 100, 'days');
 Hello World 100 days
```

## Related functions

* [`format_number` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/format_number.md)
* [`format_string` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/format_string.md)
