Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2004
    Posts
    83

    Unanswered: Removing decimals in dollar value, but keep the "cents" w/o rounding?

    I have a vendor who is requiring special formatting of a dollar values.

    If the value is $123.45, he wants to see 12345.

    How can I remove the decimal in SQL without rounding the value?

  2. #2
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    select (123.45 * 100) pennies from dual;
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  3. #3
    Join Date
    Jan 2004
    Posts
    83
    I can't use dual. Isn't there some kind of To_Char formatting I can use in my select statement?

  4. #4
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    This is just an EXAMPLE!!!

    to_chars(123.45 * 100,'99999')
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  5. #5
    Join Date
    Jan 2004
    Posts
    83
    Thanks. sometimes the simpliest math eludes me. Thanks for your suggestion.

Posting Permissions

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