Index: openacs-4/packages/ecommerce/tcl/ecommerce-money-computations-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-money-computations-procs.tcl,v diff -u -r1.7.8.2 -r1.7.8.3 --- openacs-4/packages/ecommerce/tcl/ecommerce-money-computations-procs.tcl 19 Dec 2004 10:42:11 -0000 1.7.8.2 +++ openacs-4/packages/ecommerce/tcl/ecommerce-money-computations-procs.tcl 12 Feb 2005 05:40:52 -0000 1.7.8.3 @@ -413,3 +413,15 @@ return [list $total_reg_shipping_cost $total_exp_shipping_cost 0] } + +ad_proc ec_same_value { + value_one + value_two +} { + Returns true if values are essentially the same for monetary purposes, otherwise returns false. + This takes care of comparisons of two calculated, binary values where the difference is monetarily insignificant, + yet logical comparisons would be false. +} { + set is_same [expr [expr abs( $value_one - $value_two ) ] < 0.009] + return $is_same +} \ No newline at end of file