Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2006
    Location
    near Atlanta Georgia
    Posts
    194
    Plugin Contributions
    0

    Default Attribute Controller - Prices and Weight - Decimal Values Problem

    I price my product (printed paper) using attributes with a one time charge (setup fee) + price (a running charge per sheet)...in the attribute controller for price there are 4 decimal places...but they don't seem to work like they should and it is affecting my prices:

    For example if I set it to price at .0060 and test it with a quantity of 10000 it gives me $100 when it should be $60
    I get the exact same $100 price even if I change it to .0050, .0070, .0080 or .0090 and the forth digit has no effect either .0065

    But if I go to .0040 I get a price of 0 when it should be $40

    As long as the price is .01 or greater I get a price and not 0 but it is not the right price...it seems as if everything teeters between 0.XX4X or less and 0.XX5X or greater...which really screws with my pricing method

    Can anyone tell me how to fix this and explain why it does this?
    John

  2. #2
    Join Date
    Dec 2006
    Location
    near Atlanta Georgia
    Posts
    194
    Plugin Contributions
    0

    Default Re: Attribute Controller - Prices and Weight - Decimal Values Problem

    Anyone out there that can help me out with this one?
    John

  3. #3
    Join Date
    Aug 2005
    Location
    Vic, Oz
    Posts
    1,905
    Plugin Contributions
    5

    Default Re: Attribute Controller - Prices and Weight - Decimal Values Problem

    Quote Originally Posted by GoldBuckle View Post
    explain why it does this?
    I assume your products prices are set as normal to 2 decimal places?

    So an attribute price of 0.0060 rounds up to 0.01 per item
    Then 0.01 x 10000 = $100

    .0050, .0070, .0080 or .0090 all round up to 0.01 so they are all the same price.

    Have you tried setting your products prices to 4 decimal place?

  4. #4
    Join Date
    Dec 2006
    Location
    near Atlanta Georgia
    Posts
    194
    Plugin Contributions
    0

    Default Re: Attribute Controller - Prices and Weight - Decimal Values Problem

    Ok, I just figured something out...if I go to currencies under admin and change US Dollar currency from 2 decimal places to 5 decimal places then the prices calculate correctly, but I would like for the display to only show 2 decimal places but still do calculations with 5 decimal places without rounding up or down to 2 decimal places as it affect my pricing to much for printed paper....any one have any suggestions? Surely someone else has to have come across this issue besides just me???

    John

  5. #5
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Idea or Suggestion Re: Attribute Controller - Prices and Weight - Decimal Values Problem

    Quote Originally Posted by GoldBuckle View Post
    Ok, I just figured something out...if I go to currencies under admin and change US Dollar currency from 2 decimal places to 5 decimal places then the prices calculate correctly, but I would like for the display to only show 2 decimal places but still do calculations with 5 decimal places without rounding up or down to 2 decimal places as it affect my pricing to much for printed paper....any one have any suggestions? Surely someone else has to have come across this issue besides just me???

    I know this is an old thread, but I think it is still very valid.
    Recently a customer asked me about the same problem as stated by GoldBuckle, I think a new variable should be introduced
    1. decimal places for viewing, set per currency
    2. decimal places for calculation, set in only place, or make it fixed at 4 like the database value (preferred by me).


    I do not think it is a quick fix, in a search through the files I found "decimal_places" mentioned in 10 files. Going to investigate.

  6. #6
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Attribute Controller - Prices and Weight - Decimal Values Problem

    Quote Originally Posted by Design75 View Post
    I know this is an old thread, but I think it is still very valid.
    Recently a customer asked me about the same problem as stated by GoldBuckle, I think a new variable should be introduced
    1. decimal places for viewing, set per currency
    2. decimal places for calculation, set in only place, or make it fixed at 4 like the database value (preferred by me).


    I do not think it is a quick fix, in a search through the files I found "decimal_places" mentioned in 10 files. Going to investigate.
    If not mistaken this is ¤actually wrapped around the issue of round first then multiply (happens on some pages) versus multiply then round (as desired). It is documented and addressed in several threads throughout the forum.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. v155 Attribute controller - error message when adding attribute values
    By rustwood in forum General Questions
    Replies: 8
    Last Post: 11 Jul 2016, 10:26 PM
  2. Remove Decimal from Attribute Prices?
    By swamyg1 in forum Setting Up Categories, Products, Attributes
    Replies: 11
    Last Post: 17 Oct 2012, 04:08 AM
  3. Attribute Controller: Update with new settings/prices, DO NOT add new ones?
    By eztx in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 4 May 2011, 12:32 PM
  4. Alphabetical order of Option Values in Attribute Controller
    By D-man in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 20 Dec 2008, 05:56 PM
  5. Problems in attribute controller - no option values
    By miriam_t in forum Basic Configuration
    Replies: 3
    Last Post: 28 Oct 2008, 06:49 PM

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