| Home | CDBL instead of CSNG | KV's Kool ASP | |||||||||||||||||||||||||
|
CDBL instead of CSNG Use CDbl() function instead of CSng() function while dealing with real or floating point numbers in ASP. CDbl() outputs are double-precision numbers where as CSng() outputs are single-precision numbers. So, if you use CSng(), when dealing with high precision numbers (having more decimal places), it will truncate the number and may lead to problems. For example, run the following script to see how CSng() truncates the data. <% You will get the following output: 295.3434 Recently I have got a mail from a visitor. It says: I have some problem passing decimal value from asp page to stored When I execute this page, I am getting the following error: The solution is using CDbl() instead of
CSng(). |
||||||||||||||||||||||||||
| Refer this site | ASPAlliance.com | Contact Us | Join | Advertise | Best Viewed with IE 4.0 or above | ||||||||||||||||||||||||||