Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-09-27 : 09:17:57
|
| Joey writes "Why do floating point numbers get rounded and truncated when a CONVERT is used as shown below, and, more importantly, is there any way to get a CONVERT to accurately display the floating point number in the way it is stored (without rounding and truncating it)? Thanks!/* Code: */SET NOCOUNT ONDECLARE @myfloat FLOATSET @myfloat = 1.123456789012345SELECT @myfloat AS original_floatSELECT CONVERT(VARCHAR(30),@myfloat) AS converted_float/* Results:original_float ----------------------------------------------------- 1.123456789012345converted_float ------------------------------ 1.12346*/" |
|
|
|
|
|