You can put this solution on YOUR website! if each stamp is equal to 6 dollars then the number of stamps you can buy with x dollars is equal to x/6 rounded down to the nearest integer.
example:
if you have 47 dollars, you can buy 47/6 = 7 stamps
7*6 = 42 dollars and your change will be 47 - 42 = 5 dollars.