classic asp math syntax on xml node

Posted on 2009-02-18
Last Modified: 2012-05-06
this is what I'm trying to do in the code, but I'm shady on the syntax.  
I need to multiple the result by 1.5
<%=node.selectSingleNode("@minQty").text * 1.5 %>

Open in new window

Question by:sl1nger
    LVL 14

    Expert Comment


    CInt(node.selectSingleNode("@minQty").text) * 1.5

    Author Comment

    I get an 'overflow' error when it trys to convert.  It thought it failed on 50000, but think it's because not set as integer.  How would you do an inline iif to check integer, then convert?

    LVL 14

    Accepted Solution

    you could do something like

    if IsNumeric(node.selectSingleNode("@minQty").text) then

    end if

    Also Im not sure I forget cause its been a while with XML/ASP ... have you tried it without the .Text or with .value or .nodeValue

    If those dont work, then let me know I will go look back at a piece of code or something.
    LVL 14

    Expert Comment

    or try Int(node.selectSingleNode("@minQty").text) instead
    LVL 28

    Expert Comment

    Integer is Classic ASP can not hold very large numbers, although 50,000 should be no problem. Anyway, I always use Long and not Integer for integers, and sometimes even Double.

    Converting to Long goes with Clng() and to Double with Cdbl().


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
    I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    6 Experts available now in Live!

    Get 1:1 Help Now