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

Free Components

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, San Diego Web Design

ASP Nuke CMS
Free Open Source
Content Manager
GoSwap Auctions
Buy, Sell
No Fees!

Contact Us | Contribute | About | Site Map



"Democracy consists of choosing your dictators, after they've told you what it is you want to hear." - Alan Coren

©2012 San Diego Web Design - Orvado Technologies, All Rights Reserved
ASP Nut provides articles and reference documentation for Active Server Page developers.