Skip to content

Commit

Permalink
fix price round (#37)
Browse files Browse the repository at this point in the history
* fix rounding error

* fmt
  • Loading branch information
Sladuca authored Oct 7, 2024
1 parent f70c492 commit 96ae4bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/buy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ async function buyOrderAction(options: SfBuyOptions) {
);

const priceCentsPerSecond = priceCents / durationSeconds;
const roundedPriceCents = priceCentsPerSecond * roundedDurationSeconds;
const roundedPriceCents = Math.ceil(
priceCentsPerSecond * roundedDurationSeconds,
);

priceCents = roundedPriceCents;
startDate = roundedStartDate;
Expand Down

0 comments on commit 96ae4bd

Please sign in to comment.