Results 1 to 5 of 5

Thread: Format Help

  1. #1
    Join Date
    May 2004
    Posts
    36

    Unanswered: Format Help

    i'm trying to format integers to have ,s... like 1,000 instead of 1000.
    ????????????????

  2. #2
    Join Date
    Sep 2004
    Location
    CA
    Posts
    41
    You want commas in your database? Don't you only want the commas in your application (front-end)?

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Output formatting really ought to be done on the client side, for a number of reasons.

    First and foremost, if you format the data at the server you create a logistical nightmare if/when you need to expand to support multiple locales. You'll have to write code everywhere you do formatting to determine how the data needs to be formatted for each case. This is an exercise in quick ways to create code that will drive your insane at some later date.

    From a pure performance basis, it is a poor choice to format your data before you need to. The formatting will inhibit you from being able to do any additional processing. It is really hard to add a 7.5% VAT to "$1,000.00" in the United Kingdom, while it is trivial to add the VAT to the unformatted monetary value which will also format correctly when it reaches the client!

    -PatP

  4. #4
    Join Date
    May 2004
    Posts
    36
    what i'm trying to do is write a select statement that would add the ,s in...

    is that possible??

  5. #5
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Nearly anything is possible. I'm pretty sure that it isn't a good idea. I would very strongly advise that you do your formatting on the client side, using a tool such as Crystal Reports, MS-Access, VB, etc instead of formatting the data on the server.

    -PatP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •