I'm wondering if there is a simple built in way to compare numbers that appear in columns in the database.
For example, I've got two fields, one is user inputed as #.## (where # is obviously a number), then I've got another field from a second table that is also #.## (not user inputed).
When it comes to the detailed.html template I'd like to compare these two numbers and if the user inputed number is lower then print it out in green, if it's higher than the second number then print it out in red.
Something like this maybe:
<%if card1price > get_value_prices($cardname1)%><font color="red"><%card1price%></font><%else%><font color="green"><%card1price%></font><%endif%>
I'm not sure what actually goes in the place of the ">" between card1price and get_value_prices to try to figure out if the first value is greater than the second value, or if it's even possible.
Any questions please ask.
Thanks you know who for all the help.
For example, I've got two fields, one is user inputed as #.## (where # is obviously a number), then I've got another field from a second table that is also #.## (not user inputed).
When it comes to the detailed.html template I'd like to compare these two numbers and if the user inputed number is lower then print it out in green, if it's higher than the second number then print it out in red.
Something like this maybe:
Code:
<%if card1price > get_value_prices($cardname1)%><font color="red"><%card1price%></font><%else%><font color="green"><%card1price%></font><%endif%>
I'm not sure what actually goes in the place of the ">" between card1price and get_value_prices to try to figure out if the first value is greater than the second value, or if it's even possible.
Any questions please ask.
Thanks you know who for all the help.
