SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: format result with no decimals

  1. #1
    SitePoint Zealot
    Join Date
    Aug 2006
    Posts
    130
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    format result with no decimals

    IF I'm doing a simple query like
    Code MySQL:
    SELECT product_price - product_saleprice AS savings FROM exp_foxee_skus WHERE id='{entry_id}'
    which yields a value of say 8.00. How can I eliminate the ".00" and just show round numbers?

    Thanks

  2. #2
    SitePoint Wizard guelphdad's Avatar
    Join Date
    Oct 2003
    Location
    St. Catharines, ON Canada
    Posts
    1,704
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    use ROUND

  3. #3
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    In general, formatting output is the job of the application UI, not the database system.
    17-29% of paid ad clicks are fraudulent. Get protected with Improvely, your online marketing dashboard.
    Conversion tracking, click fraud detection, A/B testing and more.

Bookmarks

Posting Permissions

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