| Author | 
                
                  Topic   | 
                
              
              
                | 
                 sji2671 
                Junior Member 
                   
                 
                
                United Kingdom 
                185 Posts  | 
                
                  
                    
                      
                       Posted - 28 March 2002 :  07:57:49
                        
                        
                      
  | 
                     
                    
                       A bit cheeky, but I have tried other resources with no luck and feel this is the best place to find someone who knows ASP.
  I have a shopping cart (midicart), problem is we sell in £, and the merchant needs the amount in dollars. I'm willing to update a figure, usually our total * 1.50 but have tried in vain to implement it.
  The line that sends the info across to the merchant is : <input type="text" name="total" size="10" VALUE="<% = Request.form("total") %>">
  I changed this to : <input type="text" name="total" size="10" VALUE="<% = Request.form("total")*1.50 %>">
  Hoping our total would be multiplied by 1.5 and given to the merchant, which it does but doesnt include a decimal place, ie £14.50 suddenly becomes $2175, I tried *0.015 but that didnt change the result. there must be a simple way to do it, but I'm stumped.
  Any help would be more than appreciated. Our shop is at : http://www.xpress-gifts.co.uk/shop The page that transfers info to the merchant is : http://www.xpress-gifts.co.uk/shop/order_transfer.asp
 
  Moved from Help/Current Version
  Edited by - Nathan on 28 March 2002  15:06:59 | 
                     
                   
                 | 
              
              
                | 
                 HuwR 
                Forum Admin 
                      
                 
                
                United Kingdom 
                20611 Posts  | 
                
                  
                    
                      
                       Posted - 28 March 2002 :  09:31:09
                        
                        
                      
  | 
                     
                    
                       ok, I would do it this way
  (CCur(Request.form("total"))*3)/2
 
  | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 sji2671 
                Junior Member 
                   
                 
                
                United Kingdom 
                185 Posts  | 
                
                  
                    
                      
                       Posted - 28 March 2002 :  09:39:01
                        
                        
                      
  | 
                     
                    
                       <input type="text" name="total" size="10" VALUE="<% = (CCur(Request.form("total"))*3)/2 %>">
  Is this the line that I should change it too then ? 
  Thanks I'll give it a go
 
  | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 HuwR 
                Forum Admin 
                      
                 
                
                United Kingdom 
                20611 Posts  | 
                
                  
                    
                      
                       Posted - 28 March 2002 :  09:53:33
                        
                        
                      
  | 
                     
                    
                       yes, or use CDbl instead of CCur, the key is changing the Request.form("total") which is a string, into a number.
 
  | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 sji2671 
                Junior Member 
                   
                 
                
                United Kingdom 
                185 Posts  | 
                
                  
                    
                      
                       Posted - 28 March 2002 :  13:12:44
                        
                        
                      
  | 
                     
                    
                       no joy i'm afraid.
  £5.44 in the shopping cart ends up as $816 , tried CDbl as well.
  Maybe this isnt as simple as I thought it was gonna be..
 
  | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 Aaron S. 
                Average Member 
                    
                 
                
                USA 
                985 Posts  | 
                
                  
                    
                      
                       Posted - 28 March 2002 :  13:22:37
                        
                        
                      
  | 
                     
                    
                       What about:
 
 <%= cint(Request.form("total"))*1.50 %>">
 
 
 
   | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 sji2671 
                Junior Member 
                   
                 
                
                United Kingdom 
                185 Posts  | 
                
                  
                    
                      
                       Posted - 28 March 2002 :  14:02:28
                        
                        
                      
  | 
                     
                    
                       driving me insane, lol.
  Still no decimal point, changes the figure from £7.44 to $1116 .
 
 
 
  | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 em_ 
                Starting Member 
                 
                 
                
                23 Posts  | 
                
                  
                    
                      
                       Posted - 28 March 2002 :  16:36:18
                        
                      
  | 
                     
                    
                       ASP can't multiply by a % AFAIK.
  I would try this:
  <% dim amt 
  amt = CDbl(Request.form("total")) * 1.5  %>
  <input type="text" name="total" size="10" VALUE="<%=amt%>">
 
 
    Do the multiplication outside of the the printing.
  If you want to round up the numbers to two digits use: 
 
  <input type="text" name="total" size="10" VALUE="<%=FormatNumber(amt,2)%>">
 
 
 
 
  Edited by - em_ on 28 March 2002  16:39:13
  Edited by - em_ on 28 March 2002  16:43:16 | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 sji2671 
                Junior Member 
                   
                 
                
                United Kingdom 
                185 Posts  | 
                
                  
                    
                      
                       Posted - 28 March 2002 :  16:44:59
                        
                        
                      
  | 
                     
                    
                       thanks, just tried that coding.
  Same result the cart came to £7.44 but when swopping to the merchant the price was $1116
  <pulls hair out>
 
  | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 sji2671 
                Junior Member 
                   
                 
                
                United Kingdom 
                185 Posts  | 
                
                  
                 | 
              
              
                | 
                 em_ 
                Starting Member 
                 
                 
                
                23 Posts  | 
                
                  
                    
                      
                       Posted - 28 March 2002 :  17:10:53
                        
                      
  | 
                     
                    
                       Are you sure you're not multiplying by something before that?  This makes no sense otherwise. Are you trying some kind of currency conversion?
 
  | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 sji2671 
                Junior Member 
                   
                 
                
                United Kingdom 
                185 Posts  | 
                
                  
                    
                      
                       Posted - 28 March 2002 :  17:19:16
                        
                        
                      
  | 
                     
                    
                       It is a crude currency conversion, were in the UK. Our merchant that will process the credit cards is US and only accepts $ figures.
  Therefore we need to transfer our total to dollars and send it to them via the <form>.
  Its an ASP shopping cart midicart.com
  The link was just the page that changes from our cart to the merchant, before that page all the shipping details etc are taken.
 
 
 
 
 
  | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 em_ 
                Starting Member 
                 
                 
                
                23 Posts  | 
                
                  
                    
                      
                       Posted - 28 March 2002 :  17:42:14
                        
                      
  | 
                     
                    
                       Can you link up your form to just to a response.write instead of submitting the data so we can see whats going on?
 
  | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 sji2671 
                Junior Member 
                   
                 
                
                United Kingdom 
                185 Posts  | 
                
                  
                    
                      
                       Posted - 28 March 2002 :  17:48:09
                        
                        
                      
  | 
                     
                    
                       lost me, how would I do that, u mean change the link of the form to ?
 
 
 
  | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 Nikkol 
                Forum Moderator 
                      
                 
                
                USA 
                6907 Posts  | 
                
                  
                    
                      
                       Posted - 28 March 2002 :  17:51:04
                        
                      
  | 
                     
                    
                       can you post the code from the page with the form that sends the total value to the page you're having problems with?
  Nikkol | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 sji2671 
                Junior Member 
                   
                 
                
                United Kingdom 
                185 Posts  | 
                
                  
                    
                      
                       Posted - 28 March 2002 :  17:55:10
                        
                        
                      
  | 
                     
                    
                       All the pages up to order_transfer.asp work fine. The order_transfer.asp page collects info from previous pages, ie items , info and sends it to the merchant 2checkout.com, getting the figure we collect in uk sterling and somehow changing it at order_transfer.asp into dollars so that the merchant gets a dollars figure is the problem
  the previous page to order_transfer.asp is : http://www.xpress-gifts.co.uk/shop/order_card.asp
  These pages are used inside a frame.
 
  | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                
                
                  Topic   | 
                  |