How can I convert my float type to a varchar datatype.
When the number has more than 6 decimal places SQL rounds the decimal portion of the number. I haven't found a way to not lossin the precision.
IF I convert the float value to a numeric value, sometimes it converts it like this: 123.985899999
and it should be 123.9859.
Does anyone know something about this?
Thanks
Comments
Numeric datatype will take ur full data if u r giving a big preicision and scale. If it so it won't round the value
please try this query, then u will come to know
Select cast(123.985899999 as numeric(15,12))
it will give the correct answer
How can I convert my float type to a varchar datatype.
: When the number has more than 6 decimal places SQL rounds the decimal portion of the number. I haven't found a way to not lossin the precision.
:
: IF I convert the float value to a numeric value, sometimes it converts it like this: 123.985899999
: and it should be 123.9859.
:
: Does anyone know something about this?
:
: Thanks
: