Skip to content

Commit

Permalink
tweak: Enforce Math.floor on stock account value shift
Browse files Browse the repository at this point in the history
  • Loading branch information
notheotherben committed Jun 15, 2024
1 parent 2c56e25 commit c20a3d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion automations/stocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class StockAutomation extends Automation {
costBasis,
cgtRate
}) * 1000;
const shift = net - account.balance;
const shift = Math.floor(net - account.balance);

// We only record transactions if they result in more than 1 unit of currency change (i.e. ignore changes in the cents range)
if (Math.abs(shift) <= 1000) return;
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74120,7 +74120,7 @@ class StockAutomation extends automation_1.Automation {
costBasis,
cgtRate
}) * 1000;
const shift = net - account.balance;
const shift = Math.floor(net - account.balance);
// We only record transactions if they result in more than 1 unit of currency change (i.e. ignore changes in the cents range)
if (Math.abs(shift) <= 1000)
return;
Expand Down

0 comments on commit c20a3d1

Please sign in to comment.