# applyFormat

Source: https://taxilang.org/docs/language/stdlib/applyFormat

**Full name:** `taxi.stdlib.applyFormat`

## Signature

```taxi
declare extension function applyFormat(input: Any, format: String):String
```

## Description

Applies a format string to the input value using [Java Formatter](https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html) conventions.

Accepts any value (string, number, date, etc.) as input. The format string controls width, padding, precision, and alignment.

```taxi
// Zero-pad an integer to 6 digits
find { order: Order } as {
   paddedId: order.id.applyFormat('%06d')
}
```

## Examples

Formats an integer with zero-padding using `%05d`.

Query:

```taxi
find {
   formatted: String = 42.applyFormat('%05d')
}
```

Result:

```json
{
  "formatted": "00042"
}
```

Left-justifies a string in a 10-character wide field using `%-10s`.

Query:

```taxi
find {
   padded: String = 'hello'.applyFormat('%-10s')
}
```

Result:

```json
{
  "padded": "hello     "
}
```
