Skip to content

Commit a611cf2

Browse files
committed
fix: float comma 2 digits
1 parent 9562b08 commit a611cf2

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/app/afip/afip.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</div>
1313
</div>
1414

15-
<button mat-raised-button color="primary" class="w-100" (click)="test()">TEST</button>
15+
<!--button mat-raised-button color="primary" class="w-100" (click)="test()">TEST</button-->
1616

1717
<div *ngIf="invoices.length > 0 && !loading" class="row">
1818
<div class="col-12">

src/app/afip/afip.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,12 @@ export class AfipComponent implements OnInit {
218218
csvContent += 'Tipo,Nro,CAE,Emisor,Emisor CUIT,Receptor,Receptor CUIT,Fecha,Importe,Importe sin IVA 21,Moneda\r\n';
219219

220220
this.invoices.forEach((row) => {
221-
csvContent += row.docName + ',' + row.docNumber + ',' + row.cae + ',' + row.nameEmi + ',' + row.cuitEmi + ',' + row.nameRec + ',' + row.cuitRec + ',' + row.date + ',' + row.amount + ',' + Number(row.amount) / 1.21 + ',' + row.currency + '\r\n';
221+
csvContent += row.docName + ',' + row.docNumber + ',' + row.cae + ',' + row.nameEmi + ',' + row.cuitEmi + ',' + row.nameRec + ',' + row.cuitRec + ',' + row.date + ',' + row.amount + ',' + (Number(row.amount) / 1.21).toFixed(2) + ',' + row.currency + '\r\n';
222222
amount = amount + Number(row.amount);
223223
amount_iva = amount_iva + (Number(row.amount) / 1.21);
224224
});
225225

226-
csvContent += ',,,,,,,,' + amount + ',' + amount_iva + ',\r\n';
226+
csvContent += ',,,,,,,,' + amount + ',' + amount_iva.toFixed(2) + ',\r\n';
227227

228228
let date = new Date()
229229
let day = `${(date.getDate())}`.padStart(2,'0');

0 commit comments

Comments
 (0)