title: How to format a lua string with a boolean variable?
body: <p>I have a boolean variable whose value I'd like to display in a formatted string. I tried using <code>string.format</code>, but get something like the following for any choice of format option listed in the <a href="http://www.lua.org/manual/5.1/manual.html#pdf-string.format" rel="noreferrer">language reference</a>:</p>
  
  <pre><code>Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
  &gt; print(string.format("%c\n", true))
  stdin:1: bad argument #2 to 'format' (number expected, got boolean)
  stack traceback:
      [C]: in function 'format'
      stdin:1: in main chunk
      [C]: ?
  </code></pre>
  
  <p>I can get the boolean to display by adding a <code>tostring</code>, </p>
  
  <pre><code>&gt; print(string.format("%s\n", tostring(true)))
  true
  </code></pre>
  
  <p>but that seems rather indirect to this lua beginner. Is there an formatting option I've overlooked? Or should I use the above approach? Something else?</p>