Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14
  1. #11
    Join Date
    Sep 2008
    Posts
    20
    Plugin Contributions
    0

    Default Re: How to round TAX/VAT the swiss way?

    Works for me !!! Big thanks.

    In effect the rounding is applied to all number calculations. I just needed to final VAT field to behave. I wonder if there is a more elegant way of resolving rounding.

  2. #12
    Join Date
    Jan 2010
    Posts
    29
    Plugin Contributions
    0

    Default Re: Europe : rounding tax to nearest .5 cents (eliminate pennies)

    Quote Originally Posted by tino.schlegel View Post
    If you want to have all currencies round to 5 cents its the easiest when you change the zen_round() function in

    /includes/functions/functions_general.php

    line 173 - 179

    Code:
    // Wrapper function for round()
      function zen_round($number, $precision) {
    /// fix rounding error on GVs etc.
        $number = round($number / 5, $precision) * 5;
    
        return $number;
      }
    Replace the entire function or add the highlighted sections.

    this is helpful. prices in website are showing correctly as well as invoice to customers. however, invoice in admin is showing without rounding to nearest 5 cents. any solution?

  3. #13
    Join Date
    Jan 2010
    Posts
    29
    Plugin Contributions
    0

    Default Sale Price: Round off to nearest 5 cents

    // Wrapper function for round()
    function zen_round($number, $precision) {
    /// fix rounding error on GVs etc.
    $number = round($number / 5, $precision) * 5;

    return $number;
    }

    I have done the above to /includes/functions/functions_general.php
    and it shows correctly in my website.

    However, the invoice at admin>order is showing without rounding off.

    I then add the above to the file myadmin/includes/functions/functions_general.php, the Price (inc) is showing with round off but Price (ex) is not.

    FYI I don't set tax for my products.

    Please advise.

  4. #14
    Join Date
    Jan 2010
    Posts
    29
    Plugin Contributions
    0

    Default Re: Europe : rounding tax to nearest .5 cents (eliminate pennies)

    another problem i found is, after rounding off to nearest 5 cents, the total value might be incorrect.

    eg.
    subtotal 23.40 (actual 23.39)
    shipping 8.65 (actual 8.63)
    total 32.00 (actual 32.02)

    any solution?

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Rounding up and rounding down how to stop this?
    By Kazz in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 9
    Last Post: 24 Jul 2008, 06:40 PM
  2. 1.40 + 0.85 = 1.90? Where did my 35 cents go?
    By 01011010 in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 12 Nov 2007, 06:53 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
  •