limmit the decimal points

  • HOW can I limit the number 1.2345678 to 1.23

    Thanks.

  • Not 100% sure of the datatype youre talking about but you could try...

    select convert (decimal(16,2), columnname) from tablename

    16=max number of digits before and after the decimal point

    2=number of digits after the decimal point

     

     

  • Try one of the following:

    floor (1.2345678 * 100) / 100

    round (1.2345678, 2)

    With this example they give the same answers, but if you use 8.7654321, the first one will return 8.76 while the second returns 8.77.

    Hope this helps.

    - Nancy

     

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

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