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

# `format_string` 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

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

## Arguments

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

## Returns

A `STRING`.

## Examples

```sql
> SELECT format_string('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)
