osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

Removing .00 in price?

This is a discussion on Removing .00 in price? within the osCMax v2 Features Discussion forums, part of the osCMax v2.0 Forums category; Is there an easy way to do this? All of my prices are in complete dollars, so I'd like ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v2.0 Forums > osCMax v2 Features Discussion

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Reply

 

LinkBack Thread Tools
  #1  
Old 10-29-2007, 09:42 PM
Lurker
 
Join Date: Oct 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
crashnscar is on a distinguished road
Default Removing .00 in price?

Is there an easy way to do this? All of my prices are in complete dollars, so I'd like to display $700 instead of $700.00

Thanks,
Nick
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 10-30-2007, 12:07 PM
Active Member
 
Join Date: Oct 2005
Location: wherever I happen to be at the moment
Posts: 405
Thanks: 3
Thanked 63 Times in 61 Posts
Rep Power: 6
met00 is a jewel in the roughmet00 is a jewel in the roughmet00 is a jewel in the roughmet00 is a jewel in the rough
Default Re: Removing .00 in price?

$price = substr($price,0,strpos($price,'.')-1);

I haven't tested that out, but that should work. It takes the price and eliminates the .00 from the string.

you might also try using the round() function.

You may also have to make a few mods on the currencies class as there are functions you may want to look at:

Code:
    function get_decimal_places($code) {
      return $this->currencies[$code]['decimal_places'];
    }

    function display_price($products_price, $products_tax, $quantity = 1) {
      return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
    }
__________________
so endith the lesson
<think>sometimes I just sit's and thinks</think>
"Here you are with a hand full of holes, a thumb up your ass, and a big grin to pass the time of day with." - TWB
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 10-30-2007, 12:57 PM
MindTwist's Avatar
Active Member
 
Join Date: Jun 2007
Location: Barcelona, Spain
Posts: 256
Thanks: 7
Thanked 21 Times in 20 Posts
Rep Power: 3
MindTwist will become famous soon enoughMindTwist will become famous soon enough
Default Re: Removing .00 in price?

You might also want to take a look at /includes/classes/PriceFormatter.php

You might be able to change it somewhere in there, and have it changed everywhere. Note, I am just guessing, I have not checked.
__________________
MindTwist of Twisted Reality and Twisted Tienda
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 10-30-2007, 10:09 PM
Lurker
 
Join Date: Oct 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
crashnscar is on a distinguished road
Default Re: Removing .00 in price?

Will this retain the two digits after the decimal place when in the shopping cart (for post tax prices)?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Quantity Price Breaks Per Product Price Table Formatter michael_s New osCommerce Contributions 0 03-22-2007 12:00 PM
Quantity Price Breaks Per Product Price Table Formatter michael_s New osCommerce Contributions 0 03-20-2007 10:02 PM
Price Break 1.11.3 -- inconsistent display of price breaks across different pages argentbeads osCMax v2 Installation issues 1 02-19-2007 08:44 PM
removing price on new product creativeone osCommerce 2.2 Modification Help 7 05-20-2005 02:35 PM
Removing price listing from "New Products For ..." JGofGFS osCommerce 2.2 Modification Help 1 03-31-2004 11:34 AM


All times are GMT -8. The time now is 10:33 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
Copyright 2008 osCMax