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

Formatting a float in varchar but NOT in scientific notation

2 views
Skip to first unread message

Mike

unread,
Oct 17, 2006, 10:51:02 AM10/17/06
to
This below formats a float in Varchar, avoiding scientific notation:

SELECT STR(@testFloat, 38, 2)

My problem is that I'm never sure how large my scale or precision needs to
be or even if I'm dealing with an integer or a float as I am enumerating
through columns, taking the float/int/varchar value and putting it into a
varchar column in a destination table.
I want to just say "enter into the destination varchar column the exact same
value as what was in the source table (whether it has 4 decimal places, no
decimal places or isn't even numeric).

For example, the above (@testFloat, 38, 2) is converting my integer such a
1856 to 1856.00 (argh!!).

can anyone help??
mike

0 new messages