Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2006
    Location
    Dartmouth, NS Canada
    Posts
    2,378
    Plugin Contributions
    0

    Default 3 decimal places needed in Price

    Hi,

    My wholesale prices are 50% of retail and my retail prices are odd numbers. So naturally my wholesale prices need to have 3 digits after the decimal place. If they don't then I get a rounding error on every single product added to the database. To be specific, my cards are 3.25 retail so 1.625 wholesale. The wholesale quantity is minimum 6, so at a minimum I am charging people 9.78 (6 x 1.63) instead of 9.75 (6 x 1.625). This difference adds up over the course of a complete order.

    To make it worse, whatever total they see in my shopping cart won't actually agree with what they get on their invoice from me, since the invoices come out of an independent accounting package. And that lack of agreement looks unprofessional, not to mention the accounting headaches it can cause.

    The change would be complex if it has to be done in the code, but perhaps it would simply be possible to adjust the number of characters stored in the appropriate columns in the DB? And everything would work right from then on? Wishful thinking?

    Rob

  2. #2
    Join Date
    Nov 2006
    Location
    Dartmouth, NS Canada
    Posts
    2,378
    Plugin Contributions
    0

    Default Re: 3 decimal places needed in Price

    It took a while But I found it.

    Run the following (if you dare) to update your DB to use 3 digits after the decimal point.

    Code:
    UPDATE 'currencies' SET decimal_places=decimal_places+1
    You might want to do this from your server's control panel, using phpMyAdmin so you can see the table data before and after to confirm everything worked.

    This will display all your prices with 3 digits after the decimal, whether they need it or not, but in my case I needed to use all 3 in calculations to avoid rounding errors.

    YMMV; do this at your own risk; I ain't an expert!

    Rob

  3. #3
    Join Date
    Jun 2003
    Posts
    33,715
    Plugin Contributions
    0

    Default Re: 3 decimal places needed in Price

    Or you could have just gone to the Admin> Localization> Currencies and changed the decimal places in your default currency.
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  4. #4
    Join Date
    Nov 2006
    Location
    Dartmouth, NS Canada
    Posts
    2,378
    Plugin Contributions
    0

    Default Re: 3 decimal places needed in Price

    This question about using more than 2 decimal places has been raised several times on the forums over the past year, all with no resolution at all. I raised it again here because I needed to resolve it for my wholesale site, and again it went unanswered. Until, that is, I solved it the hard way. At which point you come along and tell me the easy answer. Nice timing! :-]

    Rob

  5. #5
    Join Date
    Jun 2003
    Posts
    33,715
    Plugin Contributions
    0

    Default Re: 3 decimal places needed in Price

    Rob -

    If I remember correctly, the other issues were wanting to use more than 2 places and only display 2 places.
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  6. #6
    Join Date
    Nov 2006
    Location
    Dartmouth, NS Canada
    Posts
    2,378
    Plugin Contributions
    0

    Default Re: 3 decimal places needed in Price

    Hi Kim,

    Yes, I suppose that's true. I was just remembering the parts that were relevant to me of course.

    Incidentally, your answer plus my spelunking through the DB has caused me to have an epiphany. (I try not to do that in public, but once in a while it won't hurt.)

    I've often (always!) been confused about the logic behind the location of various things in the admin interface. That's why I didn't find the decimal places under Currencies. It never occurred to me to look there. I expected it in Maximum or Minimum Values or something similar under Configuration.

    I've finally realized what the logic is: the fields in any table in the DB are all grouped together in the admin interface. So all the fields from the DB table called "currencies" are configured under Localization/Currencies in admin.

    Alas, this sort of order, though it must seem obvious and even desirable to a programmer, is a good deal less than ideal from the point of view of us store geeks. I hope some rearrangement of these set-up details will be part of the eventual re-org of admin.

    Anyway, thanks for showing me where I should have made the change. I'll try to remember it for the next store.

    Rob

  7. #7
    Join Date
    Jun 2003
    Posts
    33,715
    Plugin Contributions
    0

    Default Re: 3 decimal places needed in Price

    Rob-

    It will be a while yet, but the Admin re-vamp will be much more user-friendly than the current set-up. Our priority has been getting the catalog side in shape and then working on the Admin.
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

 

 

Similar Threads

  1. Price - Decimal Places / Rounding
    By Haggis in forum Basic Configuration
    Replies: 2
    Last Post: 30 Jun 2016, 10:35 PM
  2. 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
  3. Decimal Places
    By fredmccay in forum Basic Configuration
    Replies: 0
    Last Post: 27 Jan 2011, 03:19 AM
  4. 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

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR