Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2006
    Posts
    8

    Unanswered: Custom format number

    Hi guys,

    i need to do something like this in DB2 and oracle. I have a String which actually is a number(upto 2 decimal places) converted to string. i need to format then number according to the delimiter i have.

    eg1: number is 1234567890. i need to format like
    1,234,567,890
    eg2 123456789.09 -> 123,456,789.09


    is there any built in function or a UDF which can accomplish this task ?

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    No. There is no built in function. You will need to write your own UDF.

    Andy

  3. #3
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Well, since DB2 doesn't really _display_ numbers, but only _retrieves_ them, the question doesn't make a lot of sense. It will depend on what you use to display your numbers. For example, printf() can do it for you if you use C, or Java's NumberFormat.
    ---
    "It does not work" is not a valid problem statement.

Posting Permissions

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