Skip to content

Commit

Permalink
fix: traffic estimate should Math.floor price estimate to full million
Browse files Browse the repository at this point in the history
  • Loading branch information
ivarconr committed Oct 16, 2024
1 parent 2cac903 commit 9050923
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/src/hooks/useTrafficData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ export const calculateOverageCost = (
return 0;
}

const overage = dataUsage - includedTraffic;
const overage =
Math.floor((dataUsage - includedTraffic) / 1_000_000) * 1_000_000;
return overage > 0 ? calculateTrafficDataCost(overage) : 0;
};

Expand Down

0 comments on commit 9050923

Please sign in to comment.