A Function to covert Float data column into varchar(50) w/o lossing any digits

  • (Sorry if this is for SQL 2000 only, It seems that I cannot delete)

    Hi,

    I am trying to write a function converting any float to varchar(50) without lossing any disgits:

    (1) Select col1_float, float_to_vc50(col1_float) from my table

    (2) Sample column data:

    3886.0559

    112.097

    66.8879434336119

    9999999.1234567890123456789012345678901

    ( note that the total number of digits for float is 38)

    I can try out your function on my data

    I think the key problem is declaration demical(m,n) cannot take variables

    so we stuck with fix precision and no quick way to adjust.

    Thanks

    Jack

  • Moved here: http://www.sqlservercentral.com/Forums/Topic876858-338-1.aspx

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply