G-MAX
09-05-2002, 07:21 AM
All of the documentation I've come across shows how to perform more complex math functions like Math.cos(x). What I need to do is multiply 2 variables together resulting in a 3rd variable.
Let's call our variables "%%mystore.shows.a.quantity%%", "%%mystore.shows.a.handling%%", and"%%mystore.shows.a.handling_total%%. So in essence, here's what I want to do:
%%mystore.shows.a.quantity%% *
%%mystore.shows.a.handling%% =
%%mystore.shows.a.handling_total%%
Let's say %%mystore.shows.a.quantity%% is equal to a value of "6".
Let's say %%mystore.shows.a.handling%% is equal to a value of "0.50".
I want the The resulting product value of "3" to be assigned to the variable %%mystore.shows.a.handling_total%%.
I'm not sure what's involved in writing this script and I could really use some help.
A few other things to consider:
1) The "quantity" and "handling" variables are already going to have values already assigned to them. The "handling_total" variable will be the result of their product
2) I DON'T want any of the variable values to be "manually entered in" with a button or field as in the <INPUT> command because they will already exist.
3) These variables are being used in the HTML <BODY> of an existing page.
4) These variables are being used in a table within an already existing <FORM>.
I would appreciate any help that anyone can give me. I'm not looking for someone to write the entire script for me. I just need a "push" in the right direction. This includes the proper script math commands and/or functions.
Let's call our variables "%%mystore.shows.a.quantity%%", "%%mystore.shows.a.handling%%", and"%%mystore.shows.a.handling_total%%. So in essence, here's what I want to do:
%%mystore.shows.a.quantity%% *
%%mystore.shows.a.handling%% =
%%mystore.shows.a.handling_total%%
Let's say %%mystore.shows.a.quantity%% is equal to a value of "6".
Let's say %%mystore.shows.a.handling%% is equal to a value of "0.50".
I want the The resulting product value of "3" to be assigned to the variable %%mystore.shows.a.handling_total%%.
I'm not sure what's involved in writing this script and I could really use some help.
A few other things to consider:
1) The "quantity" and "handling" variables are already going to have values already assigned to them. The "handling_total" variable will be the result of their product
2) I DON'T want any of the variable values to be "manually entered in" with a button or field as in the <INPUT> command because they will already exist.
3) These variables are being used in the HTML <BODY> of an existing page.
4) These variables are being used in a table within an already existing <FORM>.
I would appreciate any help that anyone can give me. I'm not looking for someone to write the entire script for me. I just need a "push" in the right direction. This includes the proper script math commands and/or functions.