Not Checking if Greater than 0

Hello sirs and ma’ams, today i have run into a problem. I have a bit of code, that should check if a variable “dismoney” minus a variable “cost” is >= zero.

	if (dismoney - cost >= 0)
		actualQuantity = actualQuantity + quantity;
		print (actualQuantity);
		dismoney = dismoney - cost;
		print (dismoney);

When I print actualQuantity and dismoney, actualQuantity is increased by quantity. Good. Dismoney is decreased by cost. Good. When this bit of code repeats, eventually, dismoney - cost will be < zero. Okay. Currently, cost is 10 and dismoney is 18. After 1 time, it should stop running. However, it continues to subtract, far into negatives and presumably, to no end. Full gratitude towards any/all answers :).

Hey, @UnityAlexV. The if statement is missing its set of curly brackets. Here you go:

 if (dismoney - cost >= 0) {
         actualQuantity = actualQuantity + quantity;
         print (actualQuantity);
         dismoney = dismoney - cost;
         print (dismoney);
}