how to remove trailing zeros?

  • I have this calculation I have in a script:

    ROUND(T3.NUM_POINTS * 1.0 / T4.TOTAL_RECORDS * 100,2) AS NUM_POINTS_PERCENT,

    It produces this:

    0.820000000000

    I only want 2 decimals to be displayed so the answer should be 0.82.  Another example,

    0.900000000000

    This should be 0.90

    How can I modify the format so the unneeded zeros are removed?

    Thank you

    • This topic was modified 1 month, 2 weeks ago by  water490.
  • Cast as Decimal?

    SELECT CAST(154399.234 AS DECIMAL(17,2));

  • thank you it worked!

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

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