Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Convert function from float to char, Gives me xxxxe-xx

128 views
Skip to first unread message

Rk

unread,
Jul 19, 2004, 12:41:14 PM7/19/04
to
Hello all,

When I convert a float value to char, I am getting xxxe-xx, For example..

declare @test1234 float
select @test1234 = 0.00005
select convert(char(30),@test1234)
go

Return
5.0000000000000002e-05

What settings I have to change to display "0.00005".

BTW,
ASE 12.5.1 on Sun Solaris 8

Thanks
RK


mikewatson

unread,
Jul 19, 2004, 1:24:12 PM7/19/04
to
> Hello all,
>
> When I convert a float value to char, I am getting xxxe-xx
> , For example..
>
> declare @test1234 float
> select @test1234 = 0.00005
> select convert(char(30),@test1234)
> go
>
> Return
> 5.0000000000000002e-05
>
> What settings I have to change to display "0.00005".
>
Use the str function?

declare @test1234 float
select @test1234 = 0.00005

select str(@test1234,7,5)
go

tested on 12.0 on nt

Bret Halford

unread,
Jul 21, 2004, 10:23:34 AM7/21/04
to

I agree, the STR() function is what you should be using
to convert to CHAR. That is what it is for.

-bret

0 new messages