Data Types

  • What is the most appropriate data type to use to store floating numbers?

     

    Eg, i need to store values such as (6,3) 123456.123 and (1,6) 1.123456

     

    My initial thought was to store as varchar then convert, but am i likely to run into problems later?

    Many thanks in advance....

  • Why not use the float datatype?

     

    While float is not a precise datatype, it sure beats varchar for this case.  Also you can check out the decimal option, maybe that will for for you.

  • thanks for that....

    i was being stupid!

    I had tried using decimal and then entered a figure like 12234.44444 and it was saving as just 12234 - i never noticed that the decimal was set to (18, 0) as a default!

     

    Thanks....

     

  • One less gotcha to learn .

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

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