I want to take the price value enter by the user and calculate how many points it will cost them. The points are rounded to the nearest .50 and each .50 cost 100 points ($.50 = 100 points)
Example, if user enters $3.20 then it's rounded to $3.00 and that should be 600 points.
if user enters $3.55 then it's rounded to $3.50 and that should be 700 points
For the example above
I want to add a line in the automatic posting at the end that says:
This request will cost you 600 SRF Cash!
This request will cost you 700 SRF Cash!
I think I have the formula down but not sure how to pull a value from the form
Code: Select all
$average = price; // that one stumped me since price should be the user input answer
$round_to = 0.5; // that's what I want to rounded it to the nearest half
$rounded = round($average / $round_to) * $round_to;
$srfpoints = ($rounded / $round_to) * 100;
$srfpoints = srfcash;
I made 2 sub-forums to accommodate the form, a link that leads to the actual form and a regular sub-forum were the user answers are written.
Screenshot
http://i.imgur.com/JhwBn.jpg
- If you click on the link Redeem Form Link, it will bring the application form up where you can input your answers. It looks like this (remember, I changed the fields):
http://i.imgur.com/DPg9T.jpg
- The answers will then be written in the Redeem Status forum (you can set up your permission for that forum for staff only if you choose). It looks like this:
http://i.imgur.com/kYB3v.jpg
Note: So for the request on the screen-shot, the $7.99 would be rounded to $8.00 so after Request Description, I want it to say:
This request will cost you 1600 SRF Cash!