On Sep 14, 2010, at 3:57 PM, Chris Snyder wrote: ...snip... > I'm seeing things like: ...snip... > $total = round( round( $total, 2 ) + round( $rec['amt'], 2 ), 2 ); ...snip... > Is it safe to get rid of this round( round() + round() ) pattern?
If you change it, you'll get different results in certain cases. Here's a simple example. $total = .004; $rec['amt'] = .003; echo round( round( $total, 2 ) + round( $rec['amt'], 2 ), 2 ); // prints 0 echo round( $total + $rec['amt'], 2 ); // prints 0.01 -Rob _______________________________________________ New York PHP Users Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/Show-Participation