Would double the code, what about:
<code>
   ReplaceVariableInHtml(html, variable, value ? "true" : "false");
</code>