1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-19 17:52:45 +02:00

fix: traffic estimate should Math.floor price estimate to full million

This commit is contained in:
Ivar Conradi Østhus 2024-10-16 21:00:20 +02:00
parent 2cac903068
commit 905092356a
No known key found for this signature in database
GPG Key ID: 14F51E4841AF1DE1

View File

@ -172,7 +172,8 @@ export const calculateOverageCost = (
return 0; return 0;
} }
const overage = dataUsage - includedTraffic; const overage =
Math.floor((dataUsage - includedTraffic) / 1_000_000) * 1_000_000;
return overage > 0 ? calculateTrafficDataCost(overage) : 0; return overage > 0 ? calculateTrafficDataCost(overage) : 0;
}; };