Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2012
    Posts
    254
    Plugin Contributions
    0

    Default Total is now 4 decimal places vs 2.

    Just upgraded from 1.5.4 to 1.5.7. Php was 5.3 now 7.4. In 1.5.4 all of the totals in the orders table under the column order_total were 2 decimal places and the remaining 2 decimal places were always 00. For example an order_total was 16.11 under version 1.5.4. Now under version 1.5.7 an order_total can be 16.1134. I cannot find in configuration how to limit an order total to only 2 digits and not 4 digits after the decimal. Where do I find this?

    Thank you,

  2. #2
    Join Date
    Apr 2009
    Posts
    418
    Plugin Contributions
    2

    Default Re: Total is now 4 decimal places vs 2.

    Admin>Localization>currencies is where the decimal places for each currency are stored.
    Mark Brittain
    http:\\innerlightcrystals.co.uk\sales\

  3. #3
    Join Date
    Sep 2012
    Posts
    254
    Plugin Contributions
    0

    Default Re: Total is now 4 decimal places vs 2.

    I have that set at 2 decimals. Should it be set at 0?
    Click image for larger version. 

Name:	decimals.jpg 
Views:	34 
Size:	18.3 KB 
ID:	20431

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,498
    Plugin Contributions
    88

    Default Re: Total is now 4 decimal places vs 2.

    An order-total's 'value' field, for as long as I can remember has been stored with a 4-digit decimal. That field's definition in the database is decimal(15,4).

  5. #5
    Join Date
    Sep 2012
    Posts
    254
    Plugin Contributions
    0

    Default Re: Total is now 4 decimal places vs 2.

    Quote Originally Posted by lat9 View Post
    An order-total's 'value' field, for as long as I can remember has been stored with a 4-digit decimal. That field's definition in the database is decimal(15,4).
    Old database that was running 1.5.4 had the field order-total's 'value' field set to 2-digit decimal.
    Click image for larger version. 

Name:	orders db.jpg 
Views:	17 
Size:	23.8 KB 
ID:	20435
    The new database in 1.5.7 has the order-total's 'value' field set to 4 digit decimal.
    Click image for larger version. 

Name:	new orders db.jpeg 
Views:	13 
Size:	18.0 KB 
ID:	20434
    which is causing issues in the database...
    Click image for larger version. 

Name:	order total.jpg 
Views:	14 
Size:	20.5 KB 
ID:	20437
    because when we return information from that table's field it is now not in US dollars but in fractions to the ten thousandths of a dollar.
    As posted in a previous comment, the Admin>Localization>currencies is set to 2 decimals.
    Click image for larger version. 

Name:	decimals.jpg 
Views:	12 
Size:	18.3 KB 
ID:	20436
    How do I get zen-cart to resume saving amounts in the 2 decimal format?

  6. #6
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,542
    Plugin Contributions
    19

    Default Re: Total is now 4 decimal places vs 2.

    As lat9 has mentioned, that field is decimal(15,4) by default. When in phpMyAdmin, simply click the Change button next to order_total row and set its length to 15,2

  7. #7
    Join Date
    Sep 2012
    Posts
    254
    Plugin Contributions
    0

    Default Re: Total is now 4 decimal places vs 2.

    Quote Originally Posted by balihr View Post
    As lat9 has mentioned, that field is decimal(15,4) by default. When in phpMyAdmin, simply click the Change button next to order_total row and set its length to 15,2
    This doesn't cause insertion errors when trying to insert 4 decimal places and there is only accepted? Seems like there would be an actual place in the code that would limit output to the number of decimals used in your currency and that would be the place to start looking.

  8. #8
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,542
    Plugin Contributions
    19

    Default Re: Total is now 4 decimal places vs 2.

    Quote Originally Posted by southshorepizza View Post
    This doesn't cause insertion errors when trying to insert 4 decimal places and there is only accepted? Seems like there would be an actual place in the code that would limit output to the number of decimals used in your currency and that would be the place to start looking.
    Give it a try and let us know.
    It will simply drop the last two digits while inserting. No need to adjust code if this will do the trick.

 

 

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. Decimal Places
    By fredmccay in forum Basic Configuration
    Replies: 0
    Last Post: 27 Jan 2011, 03:19 AM
  4. Decimal Places
    By Davx in forum Customization from the Admin
    Replies: 2
    Last Post: 20 Apr 2010, 04:36 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