Account Balance After Rounded Purchase

EasyMath

Solution

export function accountBalanceAfterPurchase(purchaseAmount: number): number {
  const roundedAmount = Math.round(purchaseAmount / 10) * 10;
  return 100 - roundedAmount;
}