Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Decimal points : Calculate to 3, Truncate to 2


Guest

Recommended Posts

HI,

 

I posted last nite looking for a solution for calculating to more decimal points (3), and I initally found the solution in the localization > currencies section. Anyway, it only solved my problem for about 10 minutes, until I tried to test the paypal module - which of course, does not recognise a 3 decimal xx.xxxx format. The problem is that I am selling DVD-R's discs single, per disc. I have already installed the bulk buying discount contribution, which allows me to offer discount on larger orders, and so the pricing structure we are working on, means that even the third decimal place to the right makes all the difference in our calculations (xx.xxX)

 

For example :

 

5000 discs at ?0.172 each = ?860

 

This is the price we need to sell at to remain competitive, HOWEVER - if this can't be done with 2 decimal places as the oscommerce system must round the decimals. Thus in this case

 

5000 discs at ?0.17 each = ?850

 

Therefore we are losing ?10 on this sale, and this is signigicant as it more than pays for shipping :(

 

Increasing the decimal point to 3 systemwide solves this problem whilst in oscommerce, the calculations then perform as we want BUT when we get to the payment pages and transmit them to a payment module - it causes an error as there are too many places.

 

Therefore - would it be possible to use 3 decimal places for product_info.php and on the browsing areas of the site as default - but then truncate (rather than round) the order_total prices to only 2 decimal places on the order confirmation area? I am pretty new to oscommerce and doing pretty well so far getting to grips with problems in the code, but I would need a little guidance on this, which files to look at and even if its possible.

 

Any help great appriciated x 1 squillion.

 

C

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...