|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
scientific notation and CAST or CONVERTIs it possible for me to return a very small number (5 or more decimal
places) as a string NOT in scientific notation using the CAST or CONVERT function? I want 0.0000769 not 7.96e-005. Thanks, Martha Hoffmann Is this what you are looking for?
select convert(varchar,convert(decimal(18,6),7.96e-005)) http://sqlservercode.blogspot.com/ Yes, thank you very much.
Show quote "SQL" <denis.g***@gmail.com> wrote in message news:1137088677.594526.181190@g14g2000cwa.googlegroups.com... > Is this what you are looking for? > > select convert(varchar,convert(decimal(18,6),7.96e-005)) > > http://sqlservercode.blogspot.com/ > well, what i really want to do is get rid of trailing zeroes, not matter how
many decimal places. Show quote "Martha Hoffmann" <mhoff***@gcwda.com> wrote in message news:eIvSGK6FGHA.4036@TK2MSFTNGP12.phx.gbl... > Yes, thank you very much. > > "SQL" <denis.g***@gmail.com> wrote in message > news:1137088677.594526.181190@g14g2000cwa.googlegroups.com... >> Is this what you are looking for? >> >> select convert(varchar,convert(decimal(18,6),7.96e-005)) >> >> http://sqlservercode.blogspot.com/ >> > > 1 way
select replace(rtrim(replace(convert(varchar,convert(decimal(18,6),7.96e-005)),'0',' ')),' ','0') http://sqlservercode.blogspot.com/ |
|||||||||||||||||||||||