Simple calculation from div contents
Hello,
Could someone help me with displaying a simple calculation from a div containing a price? It's to display reward points for each product in a shop.
Example:
A div with a class name of 'price' holds the price of the item. A div next to it with a class name of 'points' would display the reward points calculation. So, if an item is £20, and you get 1 point per pound spent, you would get 20 points and this would be the number shown in the 'points' div. It has to be rounded DOWN, so if the item is £19.99 they would get 19 points, not 20.
Does that make sense?
Even better would be if someone could also show me how to calculate how much those points are worth, which is 5p per point, so in this case it would be £1.00.
Thanks in advance!
|