scientific notation and decimals

  • HELP .. i have data in a table the field is nvarchar(50)

    the data is '3.6774e-008' i want it to be changed to '3.68e-08' can some one please shove me the right directions ...

     

    thanks !!

  • Just convert it to float and apply whatever format you want in front end application.

     

    _____________
    Code for TallyGenerator

  • In the ideal situation, I think you are better off changing it to decimal, change the scale to nano (x 10-9), and get rid of the exponential part. e.g. 1.23456E-8 Units ==> 12.3456 nanoUnits.  Since you want a format like 12.23, you would change the field to decimal(4, 2), and enforce your 2-digit mantissa (scale) rule automatically (with automatic rounding to a 2-digit mantissa.)

    Since users might be confused at first by the change of units, you could convert from native Units to nano-Units in the client app.

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

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