Home  |  Latest News  |  Contribute  |  F.A.Q.  |  Account  |  Scripts | About
Search ASPNut:
 
ASP Reference
Server Variables
ASP Glossary
Related Sites

Free Components

HTML Reference
Web Colors
Entities
CSS Level 1
Encode/Decode
Glossary

Our Sponsors
ASP Nuke CMS
Free Auctions
PHP 5 Script
Funktastic Blog
ULost Directory
Team Task

 

 

 

 

 

 

 

 

 

 

 

 

CSng

The CSng function will convert an ASP variant value into a single-precision floating point number. These numbers range in value from -3.402823E38 to -1.401298E-45 for negative numbers and from 1.401298E-45 to 3.402823E38 for positive numbers.

It is possible that this conversion process will generate a runtime error. For this reason, you may wish to encapsulate your conversion call with an error handler as shown in the example below:

Dim sValue
Dim fValue

sValue ="324123"
On Error Resume Next
fValue = CSng(sValue)
If Err.Number <> 0 Then
    Response.Write "An Error occurred converting to single: " & sValue
End If

Orvado Technologies

ASP Nuke CMS
Free Open Source
Content Manager
HomeFix Boards
Home Remodeling
Message Boards

Contact Us | Contribute | About | Site Map



"I only regret that I have one life to lose for my country." - Nathan Hale

©2007 Orvado Technologies, All Rights Reserved
ASP Nut provides articles and reference documentation for Active Server Page developers.