Converting Floating point #'s to Integers in ASP

Discussion in 'Classic ASP' started by Gerbill, Apr 6, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I have a problem with floating poinst. For some reason in my ASP page it is doing floating point math instead of integer math even when I cast all the variables involved to integers.

    i.e. CInt(variable) and it still comes out as a floating point number.

    Does anyone know how to set it to integers??

    Thanks,
    Gerbill

    See what I mean, hear what I say, listen for my words~
     
  2. Ok sorry for taking up forum room here... I fixed my problem.

    If anyone else needs the answer you have to do this. This is my example... actual code that I am using.

    <%
    If (intNbrItems > (intNbrItemsPerPage * (Fix (intNbrItems / intNbrItemsPerPage))))Then
    intNbrPages = (intNbrItems / intNbrItemsPerPage) + 1
    ElseIf ((intNbrItems / intNbrItemsPerPage) < 1) Then
    intNbrPages = 1
    Else
    intNbrPages = (intNbrItems / intNbrItemsPerPage)
    End If
    %>


    You have to do a "Fix(variable or math equation) and it will round it down to the next lowest #.

    I you have exp with this and find that this is not ALWAYS the case then please tell me!

    Thanks,
    Gerbill

    See what I mean, hear what I say, listen for my words~
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page