# T416

> invalid str.format template

**Severity** Error

A constant template passed to `str.format` has unbalanced braces, a placeholder index without a matching argument, or an unknown format spec. Placeholders are `{0}`, `{1:.2}` and so on; literal braces are written `{{` and `}}`.

Fix the template so every placeholder is closed and refers to an argument that exists.

## Failing example

```flowscope
script "Funding text"
data funding = subscribe(data.funding)
on funding.close {
  log.info(str.format("rate {0:.4} / predicted {1", funding.rate ?? 0.0, funding.predicted ?? 0.0))
}
```

## Fixed example

```flowscope
script "Funding text"
data funding = subscribe(data.funding)
on funding.close {
  log.info(str.format("rate {0:.4} / predicted {1:.4}", funding.rate ?? 0.0, funding.predicted ?? 0.0))
}
```

## Related

- [P007](/docs/scripting/reference/diagnostics/p007)
- [T114](/docs/scripting/reference/diagnostics/t114)
