Skip to content

Instantly share code, notes, and snippets.

@helton
Created July 23, 2017 13:56
Show Gist options
  • Save helton/0d052168d90fa30660249921df39d281 to your computer and use it in GitHub Desktop.
Save helton/0d052168d90fa30660249921df39d281 to your computer and use it in GitHub Desktop.
Full Stack Academy - Aula 02 - Exercício 02
<% include header %>
<h2>Operações</h2>
<table>
<thead>
<tr>
<th>Descrição</th>
<th>Valor</th>
<th>Sub-total</th>
</tr>
</thead>
<tbody>
<% let subTotal = 0
operacoes.forEach(operacao => {
subTotal += operacao.valor
%>
<tr>
<td><%= operacao.descricao %></td>
<td class="currency"><%= functions.formatCurrency(operacao.valor) %></td>
<td class="currency"><%= functions.formatCurrency(subTotal) %></td>
</tr>
<% }) %>
<tbody>
<tfoot>
<tr>
<td></td>
<td>Saldo</td>
<td class="currency"><%= functions.formatCurrency(functions.sum(operacoes, ({valor}) => valor)) %></td>
</tr>
</tfoot>
</table>
<% include footer %>
@tuliofaria
Copy link

Certinho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment