Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get floating number

Status
Not open for further replies.

dexeloper

Programmer
Oct 26, 2004
162
GB
I'm reading a recordset from a SQL Server procedure. One of the columns is type float but when I get it back into my ASP code I'm losing precision of the last few digits.

An example is 1125899906863598.0 which becomes
1.1258999068636E+15

Using FormatNumber doesn't help - the last few digits have somehow been lost.

Any ideas?
 
show us your sample data and how do you want it to look on your asp page...

you may use round() in your sql...

-DNG
 
Think I've cracked it.
Changed the definition in SQL Server from 'float' to 'bigint'. Casting it as varchar then preserved the lower digits. Then brought it into ASP and converted to double.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top