How to convert Exponentials value to Numerics

  • Hi SSC Experts,

    From the front end application a numeric value of 10 digits with datatype varchar(max) ex:9247497829 like Phone Number

    is entered by the front end user and is internally storing in a table as 9.2475e+009 for data security. when in the data retrieval how can we get back the original value,

    what i need is to do to convert 9.2475e+009 to its original format while retrieval.

    Thanking you in Advance,

    Jags

  • Mr.SQL DBA (8/31/2010)


    Hi SSC Experts,

    From the front end application a numeric value of 10 digits with datatype varchar(max) ex:9247497829 like Phone Number

    is entered by the front end user and is internally storing in a table as 9.2475e+009 for data security. when in the data retrieval how can we get back the original value,

    what i need is to do to convert 9.2475e+009 to its original format while retrieval.

    Thanking you in Advance,

    Jags

    excel has the bad habit of changing the display of a number to an exponent like htat; i hate that.

    even worse, you might suffer a data loss in this case; it's clear that the string "9247497829" was changed to "9.2475e+009", and then to a new string, right? if your process is storing the display value and not the editvalue, the string "9.2475e+009 " can never be converted back to the original number.

    you should not store the phone number as a varchar(max); if you stored it a decimal 19,0 or prevented the conversion from string to number to string, that issue would not occur.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Thank you for your reply.

    Jags

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

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