Re: [PHP] Ok, why is this happening...

2005-07-22 Thread Richard Lynch
On Tue, July 19, 2005 10:26 am, John Nichel said: > There's some freaky math going on there or something. I added a couple > of other echos in to see and for some reason it seems to be losing > single digit value (subtracting, rounding down, I don't know). > > $calculatedGross = $originalNet + (

Re: [PHP] Ok, why is this happening...

2005-07-19 Thread Andy Pieters
Hi I admit not gone trough all of your code, but mostly this happens when mixing the string concatenation operator (.) with the addition (+) or substraction (-) operator. HTH With kind regards Andy On Tuesday 19 July 2005 19:26, John Nichel wrote: > Chris Boget wrote: > >>Chris Boget wrote:

Re: [PHP] Ok, why is this happening...

2005-07-19 Thread John Nichel
Chris Boget wrote: Chris Boget wrote: echo "if( $originalNet != $calculatedNet ) = " . ( (int)$originalNet !== (int)$calculatedNet ) . "\n"; Change this to echo out what you're comparing... echo "if( ". (int)$originalNet ." != ". (int)$calculatedNet ." ) = " . ( (int)$originalNet !== (int)$

Re: [PHP] Ok, why is this happening...

2005-07-19 Thread Chris Boget
> Chris Boget wrote: > > > echo "if( $originalNet != $calculatedNet ) = " . ( (int)$originalNet !== > > (int)$calculatedNet ) . "\n"; > > Change this to echo out what you're comparing... > echo "if( ". (int)$originalNet ." != ". (int)$calculatedNet ." ) = " . ( > (int)$originalNet !== (int)$calcu

Re: [PHP] Ok, why is this happening...

2005-07-19 Thread John Nichel
Chris Boget wrote: echo "if( $originalNet != $calculatedNet ) = " . ( (int)$originalNet !== (int)$calculatedNet ) . "\n"; Change this to echo out what you're comparing... echo "if( ". (int)$originalNet ." != ". (int)$calculatedNet ." ) = " . ( (int)$originalNet !== (int)$calculatedNet ) . "

[PHP] Ok, why is this happening...

2005-07-19 Thread Chris Boget
Consider the following test script: set_time_limit( 0 ); echo ''; echo 'Test Rounding Net Premium'; echo ''; echo 'Running test...
'; flush(); echo ''; echo ''; echo ''; echo '
Original NetCommission %<