<script language="javascript">
var cost = {COST};
var multiplier = 3;
var total = cost*multiplier;
alert(total.toFixed(4))
</script>
Ok, so the math gives me the answer I'm after in an alert but how can I do away with the alert and have the alerts "answer" instead be a variable I can use anywhere on the page to display.
Ex.
$hello = 'goodbye';
Now I can use echo $hello; anywhere on a page to display goodbye.
Ty in advance.
var total = (cost*multiplier).toFixed(4);
Now you have the variable total you can use.
Quote from: Arantor on December 31, 2014, 05:53:41 AM
var total = (cost*multiplier).toFixed(4);
Now you have the variable total you can use.
Ty for that.