Make sure user inputs a denomination of 500

Hi,

I have a field which a user will fill out to bid on an item, however I need what they enter to be a denomination of 500.

At the moment I have it working so that the amount the user enters has to be more than the current bid amount in the database.

if ($amount > $row_RSproperty['propCurrBid'])

Open in new window


How do I go about making sure what they put is a denomination of 500?

Thanks,

Chris
djfenomAsked:
Who is Participating?
 
SlimshaneeyCommented:
Simple. Use the mod operator to check if there is a remainder like this:

if ($amount > $row_RSproperty['propCurrBid'] and $amount % 500 == 0)
0
 
djfenomAuthor Commented:
I knew it would be simple!

Thanks,

Chris
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.