Comma Formatted Numbers

  • I tried to find how to format a number as a string with commas (9,999.00 or 10,101). Is there an easy way to do this or do I need a function?

  • You need to use your own if the following example is not what you need:

    select convert( char, $3133845.54, 1 )

    Michael

  • This is something I have always done with the front end. The main reason for this is that depending on the clients regional settings you may have the comman there or not. So doing the formatting on the back end just doesn't make a lot of sense most of the time.

    Gary Johnson

    DBA

    Sr. DB Engineer




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

  • Gary, In general I would do the same thing. However, in this instance the data that the users will be using has suppression rules and the numbers that are suppressed needs to be identified with the word "Suppressed" and this needs to be done in all reporting. For consistancy delivery via a view makes the most sense if the suppression rules change then modifying the view takes care of many reports. Art

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

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