|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Why doesnt "Cint" work?
Hi, im trying to round a floating point number to an integer using this ASP page:
Code:
<%@ Language=VBScript %>
<% Option Explicit %>
<!--#include virtual="/adovbs.inc"-->
<!--#include file="dataConnect.asp"-->
<%
Cint("43.3")
%>
<html>
<p>Hello</p>
</body>
</html>
And for some reason this does not work, and i get this error message: Microsoft VBScript runtime error '800a01ca' Variable uses an Automation type not supported in vbscript: 'Cint' /atktBook_06.asp, line 8 Can anyone help me wit this please? Many thanks -seb |
|
#2
|
||||
|
||||
|
cInt is used to convert a string to an Integer. And it only works when the string is a valid integer. Not sure if VBScript has a math round feature but I know JavaScript does, just search the forums for Math.Round()
Good Luck! |
|
#3
|
|||
|
|||
|
OK what's wrong here...
<% Cint("43.3") %> Do you see it yet? Cint() definition: Returns an expression that has been converted to a Variant of subtype Integer. That means that it returns something but where are you putting that return value ??? Try this: <% Dim lngMyReturnedValue lngMyReturnedValue = Cint("43.3") Response.Write "The Cint() of 43.3 is : " & lngMyReturnedValue %> Hope this helps! Sincerely Vlince |
|
#4
|
|||
|
|||
|
Thanks Vlince...i figured out what you said already...duh! what a stupid mistake! Thanks for all your help anyways.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Why doesnt "Cint" work? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|