In my experience reusing a hidden field which will always be of type 'String' is cumbersome when continually working with numeric values. All of the casting each time introduces potential for error. I recommend using a local variable of type Decimal that
takes the value of the hidden field 1 time, casts it a single time and then uses the local variable.
Even using the hidden field value 'hidOrderTotal' you are casting it sometimes to double via CDbl and sometimes to CSng. At least keep the casting consistent.
I can not immediately see reassignment of a shipping value to the 'hidOrderTotal' value. To figure this out (shouldn't be too difficult), place a breakpoint at the beginning of the method with the value is "0.00" and walk debugging the code to see when
it changes to the unwanted value before the final assignment to: objCC.OrderAmount.
Lastly, make sure you don't just have some weired anomaly where the shipping price is equal to the order price and the values are actually correct. (i.e. shipping is $15.50 and so is the total order amount).
atconway
All-Star
16846 Points
2756 Posts
Re: Please Help
Oct 26, 2011 03:43 PM|LINK
A few recommendations