http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7495

             Bug #: 7495
           Summary: Tax calculations problem for new orders.
    Classification: Unclassified
 Change sponsored?: ---
           Product: Koha
           Version: rel_3_6
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: Acquisitions
        AssignedTo: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]


When creating a new order, the automatic tax calculations may sometimes be
wrong because of loss of precision.

Example :
With gist=0, create a new order and put 18.99 into the "Vendor price" field.
The "Budgeted cost" and "Total" fields are automatically set to 18.98 when they
should be 19.99
The same happens with 16.99 .

Possible cause of the problem :
http://stackoverflow.com/questions/3730019/why-not-use-double-or-float-to-represent-currency

Here are some utility functions that could be used to correct the problem :
function to_Cents(val) {
    return Math.round(val*100);
}

function to_Dollars(val) {
    return (Math.round(val)/100).toFixed(2);
}

-- 
Configure bugmail: 
http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to