Home - Waterfall Grid T-Grid Console Builders Recent Builds Buildslaves Changesources - JSON API - About

Change #3597

Category None
Changed by Bill Erickson <berickxxohnoyoudont@gmail.com>
Changed at Tue 25 Oct 2016 16:26:06
Repository git://git.evergreen-ils.org/Evergreen.git
Project Evergreen
Branch master
Revision 4efe500ae5129aa6870bca722146bc94d9f9bfd1


LP#1282751 Credit card payment balance owed rounding fix
Avoid using Perl's int() when summing owed/paid totals for display in
the TPAC credit card payment form, since this can lead to rounding

A simple example of why we should not use int() when summing floating
point numbers:

perl -e 'print "no match\n" unless ((8.29 * 100) == int(8.29 * 100))';

Furthermore, use the relatively new fpsum() utility function for summing
floating point numbers so we can avoid having multiple versions of the
summing logic floating (*cough*) around (*cough cough*).

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>

Changed files