This commit is contained in:
John Yeo
2025-12-22 10:45:49 +00:00
parent 42999f1455
commit 7ee92f4e88
90 changed files with 1673 additions and 432 deletions

View File

@@ -0,0 +1,15 @@
import { Decimal } from "decimal.js";
export const roundUsageToNearestBillingUnit = ({
usage,
billingUnits,
}: {
usage: number;
billingUnits: number;
}): number => {
return new Decimal(usage)
.div(billingUnits)
.ceil()
.mul(billingUnits)
.toNumber();
};