Created
July 23, 2017 13:56
-
-
Save helton/0d052168d90fa30660249921df39d281 to your computer and use it in GitHub Desktop.
Full Stack Academy - Aula 02 - Exercício 02
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% 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 %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Certinho.