Division In ASP
When I do something like this:
AllRevenueAttnAnnual = Result1 % Result2
I get an error - Invalid character
I am trying to dive Result1 by result2.
When I do something like this:
AllRevenueAttnAnnual = Result1 % Result2
I get an error - Invalid character
I am trying to dive Result1 by result2.
I'm trying to divide a filesize in bytes by 1024 so I'll get a filesize in Kb. I want a round number but instead i'm getting a result of ten decimals. Who knows how solve this?
View Replies View Relatedi know, this shouldnt be a conundrum right? one just shouldnt divide by zero. but this is suddenly happening *all over* my site. after chasing the error here and there, i simplified things down to:
response.write cstr(4/2)
response.end
and i STILL get the error:
Microsoft VBScript runtime error '800a000b'
Division by zero
[followed by the line on which the error occurs]
so i know it's not my code. how can you get a division by zero error when you'r dividing with CONSTANTS??? did i change some obscure setting or something?now mind you, i tried "response.write cstr(4+2)" and the system managed to output "6".
I have the following code in a script:
' Pecentage Interest on Loan
YearlyInterestPercent = 6.5
' Get Annual Interst Rate from Interest Percentage
YearlyInterestRate = YearlyInterestPercent / 100
' Divide Yearly Interest Rate by 12
' to Get Monthly Interst Rate
MonthlyInterestRate = YearlyInterestRate / 12
These values are supplied by the user using a form but I made them static for this example. For some reason, when dividing the Yearly Interst rate by twelve, MonthlyInterestRate equals 5.41666666666667E-03. The result should be 0.005416667. Does anyone know what I can do to correct this?
I have some values that I want to display as percent, such as the
retail price/wholesale price. In some instances, the wholesale price
is zero, so I get a division by zero error.
What can I do to avoid this?
Also, how can I get this to only show two decimals, instead of it
going .##### the way it does. I want it to look like .45%
I am accessing the same error-containing ASP page on an ISP server using w2k IE6 but with different effect. On the first computer I get several line of HTML outputed by ASP, shown correctly by the browser, followed by a descriptive error message:
Microsoft VBScript runtime error '800a000b'
Division by zero
followed by the number of the error-making line. On the second machine my HTML is not displayed at all. Instead I am getting that meaningless error page sayng that The page cannot be displayed, HTTP 500 - Internal server error. How can I get the second computer be more informative about the errors?