MMTMMT Docs
Diagnostics

T416

invalid str.format template

T416

A constant str.format template has malformed braces or an invalid placeholder. Escape literal braces and match placeholders to values.

Failing example

script "conf"

data chart = subscribe(data.ohlcv)

on chart.update {
  let a = str.format("{1}", 1.0)
  let b = str.format("{0:x}", 1.0)
  let c = str.format("{0:.2}", "s")
  let d = str.format("{0:,}", "s")
  let _ = str.concat(a, b, c, d)
}

Corrected example

script "fixed"
data chart = subscribe(data.ohlcv)
on chart.update { let text = str.format("value {}", chart.close) }

On this page