Skip to main content

Financial Calculations

Common financial calculations are implemented in shared/financial-calculations.ts.

Apply Basis Points

export function applyBpsToMinor(amount: number, bps: number): number {
return Math.round((amount * bps) / BASIS_POINTS_SCALE);
}

Example:

const fee = applyBpsToMinor(1000000, 250); // 2.5% of 10,000 BDT
// Result: 25000 (250 BDT)

Interest Calculations

Use standard formulas from the financial constants module for consistent calculations across the application.