Help with Variable Mutiplication

Results 1 to 2 of 2

Thread: Help with Variable Mutiplication

  1. #1
    Join Date
    Dec 1969

    Default Help with Variable Mutiplication

    I&#039m writing a shopping cart application and having trouble with calculating the subtotals.<BR><BR>This is how it&#039s setup: the quantity is pulled from input box with default value which I set to 1. That is then multiplied by UnitPrice, which is a value I&#039m pulling from the database. After trying to multiply the two together and generate a result, I end up with 0. Please help.<BR><BR>Oh, and I have already tried converting the quantity value to an integer and then multiplying. I have also trying converting both to a double since UnitPrice is a floating point # and then multiplying. Still no luck. End result is 0. HELP!

  2. #2
    Karl Guest

    Default RE: Help with Variable Mutiplication

    Debug..if you are doing simple math and you aren&#039t getting what you should be, then your variables don&#039t contain what you expect them to.<BR><BR>display the values of those variables to the screen and see what they probably find out that one of them is a 0 when it shouldn&#039t be...which means you aren&#039t passing it right, retrieving it right, or converting it to a numerical value right.<BR><BR>--<BR>Karl

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts