Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    May 2006
    Posts
    15
    Plugin Contributions
    0

    Default Using 4 decimal places (Currency) whilst displaying only 2?

    Hello,

    Is it possible to set the Currency to use 4 decimal places, but have the front end only display the first 2 (or hide the last 2)?

    I have tried setting My Store/ Tax Decimal Places to 2 but it still displays all 4 on the front end.

    This might well solve a rounding issue i have where leaving the currency to use 2 decimal places is causing my tax calculations to be out ny 0.01p, I think due to rounding. Bizarrely the figures are correct most of the time!

    Example:

    £83.55
    Sub-Total:

    £10.00
    Delivery (Delivery):

    £16.38
    UK VAT:

    £109.93
    Total:

    VAT should actually be £16.37 (from 16.37125)


    Thanks

    Guy

  2. #2
    Join Date
    Mar 2008
    Location
    Cape Town & London (depends on the season)
    Posts
    2,975
    Plugin Contributions
    0

    Default Re: Using 4 decimal places (Currency) whilst displaying only 2?

    Guy, when I add products to my store, I always insert the price to 4 decimal places:-

    £4.95 is input as 4.9500

    Have you tried this on your "rogue" products?

  3. #3
    Join Date
    May 2006
    Posts
    15
    Plugin Contributions
    0

    Default Re: Using 4 decimal places (Currency) whilst displaying only 2?

    Yes all of my products have been entered with 4 decimals, i.e £4.95 is entered as 4.9500.

    If I set Localization/Currencies/ GB Pound (Default)/ to Decimal places 4, the resulting price in the cart is correct. However it is a bit much for the site cusotmers to see: £16.37125!

    Setting it back to 2 is where the rounding issues arise.

    Thanks for you help.

    Guy

  4. #4
    Join Date
    Mar 2008
    Location
    Cape Town & London (depends on the season)
    Posts
    2,975
    Plugin Contributions
    0

    Default Re: Using 4 decimal places (Currency) whilst displaying only 2?

    What about:-

    ADMIN>>>CONFIGURATION>>>MY STORE>>>Tax Decimal Places... ?

    Set to " 4 "

  5. #5
    Join Date
    May 2006
    Posts
    15
    Plugin Contributions
    0

    Default Re: Using 4 decimal places (Currency) whilst displaying only 2?

    Changing that doesn't seem to affect the payment calculations - shame!

  6. #6
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Using 4 decimal places (Currency) whilst displaying only 2?

    Sorry for digging up an old thread here, but there's not a lot about decimal places on the forum, at least I can't find anything..

    I've been working on a script that uploads product details to Twitter automatically. I have iit working about 99.9% but just one annoyance. When I upload the product, it's sending the special price to 4 decimal places £49.9900 instead of just £49.00

    Can anyone see what I need to add to this section of the script so that it outputs to 2 decimal places only?

    $display_special_price = zen_get_products_special_price($products_id, true)

  7. #7
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Using 4 decimal places (Currency) whilst displaying only 2?

    OK, solved:

    round(zen_get_products_special_price($products_id, false), 2)

  8. #8
    Join Date
    Oct 2008
    Location
    Singapore
    Posts
    23
    Plugin Contributions
    0

    Default Re: Using 4 decimal places (Currency) whilst displaying only 2?

    Hi limelites,

    which file should i edit "round(zen_get_products_special_price($products_id, false), 2) "

    can i know which file are you referring to?

    thanks!
    Henry

  9. #9
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Using 4 decimal places (Currency) whilst displaying only 2?

    admin/includes/modules/update_product.php

  10. #10
    Join Date
    Oct 2008
    Location
    Singapore
    Posts
    23
    Plugin Contributions
    0

    Default Re: Using 4 decimal places (Currency) whilst displaying only 2?

    Hi limelites,
    I checked the file, but it does not have zen_get_products_special_price. Can you help me by pointing out which line and exactly what you did.

    There are many other people with the same problem, and i believe many people will benefit from your invaluable reply.

    thanks in advance!

    Henry

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Currency Setting of Decimal Places vs pricing to 5 decimal places?
    By GoldBuckle in forum Customization from the Admin
    Replies: 0
    Last Post: 20 Aug 2013, 05:16 PM
  2. v150 Confirmation Email Order Total displaying three decimal places
    By PMguy2004 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 14 Sep 2012, 07:50 PM
  3. Round currency to dollar but still display 2 decimal places
    By shirster in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 0
    Last Post: 17 May 2011, 05:23 AM
  4. Replies: 9
    Last Post: 24 Jul 2010, 11:56 AM
  5. Displaying Price to 3 decimal places
    By actionjackson57 in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 4 Dec 2009, 09:16 AM

Posting Permissions

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