Skip to content

Commit

Permalink
Fix unitPrice calculation for etoro
Browse files Browse the repository at this point in the history
  • Loading branch information
dickwolff authored Feb 9, 2024
1 parent ec378fb commit beb2d6d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/converters/etoroConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,16 @@ export class EtoroConverter extends AbstractConverter {
continue;
}

const unitPrice = parseFloat(record.amount / record.units).toFixed(6);

// Add record to export.
result.activities.push({
accountId: process.env.GHOSTFOLIO_ACCOUNT_ID,
comment: "",
fee: 0,
quantity: record.units,
type: GhostfolioOrderType[record.type],
unitPrice: record.amount,
unitPrice: unitPrice,
currency: currency,
dataSource: "YAHOO",
date: date.format("YYYY-MM-DDTHH:mm:ssZ"),
Expand Down

0 comments on commit beb2d6d

Please sign in to comment.