I have a template that looks like this: (I removed some elements of the table just to keep the code short)
{{#each Tables}}
<div id='report-container'>
<table id='report-table'>
<tr class='header-row'>
<th style='width: 150px; max-width: 150px !important;'>{{this.Title}}</th>
<th>Total Company Net Sales $</th>
...
</tr>
{{#each this.Data}}
<tr>
<td>{{RowTitle}}</td>
<td>{{currency TotalCompanyNetSales}}</td>
...
</tr>
{{/each}}
</table>
</div>
{{/each}}
With a helper:
handleBars.RegisterHelper("currency", (writer, context, parameters) =>
{
var value = decimal.Parse(parameters[0].ToString());
value /= 1000;
var result = value.ToString("0,-28:C2");
return result;
});
Im not sure if the object itself is relevant but I can post if necessary. The problem is just with the helper. When I try to compile the template I get the following error message:
"Reached end of template before block expression 'currency' was closed"
If I remove the currency helper the value displays fine. It never even calls the currency function. Any idea what I am doing wrong here?