Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Prices rounding to the nearest dollar


Craig_B

Recommended Posts

Posted

I am still having issues with this and do not know where to look. The prices in the database are correct but still not displaying properly.

 

Any help would be most appreciated!

 

thanks,

Craig

Posted

In Admin CP --> Configuration --> My Store --> Set decimal places

 

There is also a value in your SQL DB if the first fix doesn't pan out.

Posted

Admin > Configure > My Store > Tax Decimal Places set to 2

-and-

Admin > Localization > Currency > Decimal places set to 2

 

I have also checked the SQL and it has the correct values in the DB. I am not sure where to look now. I am sure it has something to do with the setting the Canadian dollar as default as the US store works fine.

Posted
Admin > Configure > My Store > Tax Decimal Places set to 2

-and-

Admin > Localization > Currency > Decimal places set to 2

 

I have also checked the SQL and it has the correct values in the DB. I am not sure where to look now. I am sure it has something to do with the setting the Canadian dollar as default as the US store works fine.

Prices all show 2 decimal places on the CA site so your problem is with the rounding function rather than decimal places. Sorry for the misunderstanding. :)

 

In your functions file(s), what do you have for tep_round?

Posted

In funtions > general.php I have this:

 

// Wrapper function for round()
 function tep_round($number, $precision) {
   if (strpos($number, '.') && (strlen(substr($number, strpos($number, '.')+1)) > $precision)) {
     $number = substr($number, 0, strpos($number, '.') + 1 + $precision + 1);

     if (substr($number, -1) >= 5) {
       if ($precision > 1) {
         $number = substr($number, 0, -1) + ('0.' . str_repeat(0, $precision-1) . '1');
       } elseif ($precision == 1) {
         $number = substr($number, 0, -1) + 0.1;
       } else {
         $number = substr($number, 0, -1) + 1;
       }
     } else {
       $number = substr($number, 0, -1);
     }
   }

 

I don't believe that I touched this file though <_<

  • 1 month later...
Posted

:blink: I?m havin the same problem, i checked all the parameters and the tep_round function, all are correct.

 

Somebody can help us ?URGENT!

Posted
:blink: I?m havin the same problem, i checked all the parameters and the tep_round function, all are correct.

 

Somebody can help us ?URGENT!

have you set up your tax and zones

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Posted

:huh: Yes, i check for taxes, but the problem persist.

 

Please give me the ligth

:ph34r:

  • 2 months later...
Posted

Having same rounding issue as those above. Using USD. Only thing I have messed with in currencies is that I turned off all currencies but USD. mySQL reflects correct values as well as admin. I have zones and taxes setup. Have looked at all round, tep_round, ceil and find nothing out of the way. If the price of a product is .125 (12 and half cents). An order of 500 should total $62.50 without tax but it totals $65 because it rounds the product price to .13! If I change the decimal places in the USD currency to 3 or 4 or more then the price is correct but of course displays unneeded decimal places. Please help!

  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...