|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
grand total
Hello,Robert Orlini 07/11/03 08:55 A question:Tony Weeg 07/11/03 08:58 A <cfset grandtotal = 0>Stephen Moretti 07/11/03 09:41 A yeah, what he said....thats where I was going...just too early to get itTony Weeg 07/11/03 09:43 A Sorry for the vagueness of my email. seesion.cart[i][2] holds the quantity info multiplied by the price or session.cart[i][3].Robert Orlini 07/11/03 09:03 A is that an array or structure?Tony Weeg 07/11/03 09:05 A I would do something like this.Tony Weeg 07/11/03 09:12 A An array.Robert Orlini 07/11/03 09:16 A ok...either way, you can loop through that,Tony Weeg 07/11/03 09:26 A All is OK. Thanks for the suggestions!Robert Orlini 07/11/03 10:01 A Hello, I'm still a newbie on CF so please bear with me. I had a co-worker help me with some CF programming for a shopping cart. This code gives me the totalprice: <CFSET totalprice=decimalformat(session.cart[i][2]) * session.cart[i][3]>#dollarformat(totalprice)# How can I calculate a grand total adding up all the results of each total price generated in the session? So far I have: <CFSET grandtotalprice=decimalformat(totalprice) + ????? >#dollarformat(grandtotalprice# Any help appreciated. Thanks as always. Robert Orlini HW Wilson 718-588-8400 x2656 ô¿ô question: session.cart[i][2] is an array called cart? and its set to a session var? and here you would be pulling the 2nd position from that array, on the iteration number that "I" resolves to? tony weeg uncertified advanced cold fusion developer tony at navtrak dot net www.navtrak.net office 410.548.2337 fax 410.860.2337 Hello, I'm still a newbie on CF so please bear with me. I had a co-worker help me with some CF programming for a shopping cart. This code gives me the totalprice: <CFSET totalprice=decimalformat(session.cart[i][2]) * session.cart[i][3]>#dollarformat(totalprice)# How can I calculate a grand total adding up all the results of each total price generated in the session? So far I have: <CFSET grandtotalprice=decimalformat(totalprice) + ????? >#dollarformat(grandtotalprice# Any help appreciated. Thanks as always. Robert Orlini HW Wilson 718-588-8400 x2656 ô¿ô <cfset grandtotal = 0> <cfloop from="1" to="#ArrayLen(session.cart)#" index="i"> <cfset grandtotal = grandtotal + (session.cart[i][2]*session.cart[i][3])> </cfloop> <cfoutput>#grandtotal#</cfoutput> Stephen > Hello, > > I'm still a newbie on CF so please bear with me. I had a co-worker help me with some CF programming for a shopping cart. > > This code gives me the totalprice: <CFSET totalprice=decimalformat(session.cart[i][2]) * session.cart[i][3]>#dollarformat(totalprice)# > > How can I calculate a grand total adding up all the results of each total price generated in the session? ----- Excess quoted text cut - see Original Post for more ----- yeah, what he said....thats where I was going...just too early to get it 100% right without running it ;) tony weeg uncertified advanced cold fusion developer tony at navtrak dot net www.navtrak.net office 410.548.2337 fax 410.860.2337 <cfset grandtotal = 0> <cfloop from="1" to="#ArrayLen(session.cart)#" index="i"> <cfset grandtotal = grandtotal + (session.cart[i][2]*session.cart[i][3])> </cfloop> <cfoutput>#grandtotal#</cfoutput> Stephen > Hello, > > I'm still a newbie on CF so please bear with me. I had a co-worker > help me with some CF programming for a shopping cart. > > This code gives me the totalprice: <CFSET totalprice=decimalformat(session.cart[i][2]) * session.cart[i][3]>#dollarformat(totalprice)# > > How can I calculate a grand total adding up all the results of each > total price generated in the session? ----- Excess quoted text cut - see Original Post for more ----- Sorry for the vagueness of my email. seesion.cart[i][2] holds the quantity info multiplied by the price or session.cart[i][3]. Robert O. question: session.cart[i][2] is an array called cart? and its set to a session var? and here you would be pulling the 2nd position from that array, on the iteration number that "I" resolves to? tony weeg uncertified advanced cold fusion developer tony at navtrak dot net www.navtrak.net office 410.548.2337 fax 410.860.2337 Hello, I'm still a newbie on CF so please bear with me. I had a co-worker help me with some CF programming for a shopping cart. This code gives me the totalprice: <CFSET totalprice=decimalformat(session.cart[i][2]) * session.cart[i][3]>#dollarformat(totalprice)# How can I calculate a grand total adding up all the results of each total price generated in the session? So far I have: <CFSET grandtotalprice=decimalformat(totalprice) + ????? >#dollarformat(grandtotalprice# Any help appreciated. Thanks as always. Robert Orlini HW Wilson 718-588-8400 x2656 ô¿ô is that an array or structure? tony weeg uncertified advanced cold fusion developer tony at navtrak dot net www.navtrak.net office 410.548.2337 fax 410.860.2337 Sorry for the vagueness of my email. seesion.cart[i][2] holds the quantity info multiplied by the price or session.cart[i][3]. Robert O. question: session.cart[i][2] is an array called cart? and its set to a session var? and here you would be pulling the 2nd position from that array, on the iteration number that "I" resolves to? tony weeg uncertified advanced cold fusion developer tony at navtrak dot net www.navtrak.net office 410.548.2337 fax 410.860.2337 Hello, I'm still a newbie on CF so please bear with me. I had a co-worker help me with some CF programming for a shopping cart. This code gives me the totalprice: <CFSET totalprice=decimalformat(session.cart[i][2]) * session.cart[i][3]>#dollarformat(totalprice)# How can I calculate a grand total adding up all the results of each total price generated in the session? So far I have: <CFSET grandtotalprice=decimalformat(totalprice) + ????? >#dollarformat(grandtotalprice# Any help appreciated. Thanks as always. Robert Orlini HW Wilson 718-588-8400 x2656 ô¿ô I would do something like this. <cfset session.grandTotal = 0> <cfloop index = "i" list = "yourStructureAsAList"> <cfset session.grandTotal = session.grandTotal + (decimalformat(session.cart[i][2]) * session.cart[i][3])> </cfloop> <cfset myGrandTotal = #session.grandTotal#> tony weeg uncertified advanced cold fusion developer tony at navtrak dot net www.navtrak.net office 410.548.2337 fax 410.860.2337 is that an array or structure? tony weeg uncertified advanced cold fusion developer tony at navtrak dot net www.navtrak.net office 410.548.2337 fax 410.860.2337 Sorry for the vagueness of my email. seesion.cart[i][2] holds the quantity info multiplied by the price or session.cart[i][3]. Robert O. question: session.cart[i][2] is an array called cart? and its set to a session var? and here you would be pulling the 2nd position from that array, on the iteration number that "I" resolves to? tony weeg uncertified advanced cold fusion developer tony at navtrak dot net www.navtrak.net office 410.548.2337 fax 410.860.2337 Hello, I'm still a newbie on CF so please bear with me. I had a co-worker help me with some CF programming for a shopping cart. This code gives me the totalprice: <CFSET totalprice=decimalformat(session.cart[i][2]) * session.cart[i][3]>#dollarformat(totalprice)# How can I calculate a grand total adding up all the results of each total price generated in the session? So far I have: <CFSET grandtotalprice=decimalformat(totalprice) + ????? >#dollarformat(grandtotalprice# Any help appreciated. Thanks as always. Robert Orlini HW Wilson 718-588-8400 x2656 ô¿ô An array. RO is that an array or structure? tony weeg uncertified advanced cold fusion developer tony at navtrak dot net www.navtrak.net office 410.548.2337 fax 410.860.2337 Sorry for the vagueness of my email. seesion.cart[i][2] holds the quantity info multiplied by the price or session.cart[i][3]. Robert O. question: session.cart[i][2] is an array called cart? and its set to a session var? and here you would be pulling the 2nd position from that array, on the iteration number that "I" resolves to? tony weeg uncertified advanced cold fusion developer tony at navtrak dot net www.navtrak.net office 410.548.2337 fax 410.860.2337 Hello, I'm still a newbie on CF so please bear with me. I had a co-worker help me with some CF programming for a shopping cart. This code gives me the totalprice: <CFSET totalprice=decimalformat(session.cart[i][2]) * session.cart[i][3]>#dollarformat(totalprice)# How can I calculate a grand total adding up all the results of each total price generated in the session? So far I have: <CFSET grandtotalprice=decimalformat(totalprice) + ????? >#dollarformat(grandtotalprice# Any help appreciated. Thanks as always. Robert Orlini HW Wilson 718-588-8400 x2656 ô¿ô ok...either way, you can loop through that, <cfset theList = arrayToList(session.cart)> then loop through that.... tony weeg uncertified advanced cold fusion developer tony at navtrak dot net www.navtrak.net office 410.548.2337 fax 410.860.2337 An array. RO is that an array or structure? tony weeg uncertified advanced cold fusion developer tony at navtrak dot net www.navtrak.net office 410.548.2337 fax 410.860.2337 Sorry for the vagueness of my email. seesion.cart[i][2] holds the quantity info multiplied by the price or session.cart[i][3]. Robert O. question: session.cart[i][2] is an array called cart? and its set to a session var? and here you would be pulling the 2nd position from that array, on the iteration number that "I" resolves to? tony weeg uncertified advanced cold fusion developer tony at navtrak dot net www.navtrak.net office 410.548.2337 fax 410.860.2337 Hello, I'm still a newbie on CF so please bear with me. I had a co-worker help me with some CF programming for a shopping cart. This code gives me the totalprice: <CFSET totalprice=decimalformat(session.cart[i][2]) * session.cart[i][3]>#dollarformat(totalprice)# How can I calculate a grand total adding up all the results of each total price generated in the session? So far I have: <CFSET grandtotalprice=decimalformat(totalprice) + ????? >#dollarformat(grandtotalprice# Any help appreciated. Thanks as always. Robert Orlini HW Wilson 718-588-8400 x2656 ô¿ô All is OK. Thanks for the suggestions! Robert O. yeah, what he said....thats where I was going...just too early to get it 100% right without running it ;) tony weeg uncertified advanced cold fusion developer tony at navtrak dot net www.navtrak.net office 410.548.2337 fax 410.860.2337 <cfset grandtotal = 0> <cfloop from="1" to="#ArrayLen(session.cart)#" index="i"> <cfset grandtotal = grandtotal + (session.cart[i][2]*session.cart[i][3])> </cfloop> <cfoutput>#grandtotal#</cfoutput> Stephen > Hello, > > I'm still a newbie on CF so please bear with me. I had a co-worker > help me with some CF programming for a shopping cart. > > This code gives me the totalprice: <CFSET totalprice=decimalformat(session.cart[i][2]) * session.cart[i][3]>#dollarformat(totalprice)# > > How can I calculate a grand total adding up all the results of each > total price generated in the session? ----- Excess quoted text cut - see Original Post for more -----
|
June 19, 2013
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||