Re: [php-list] Money Calculations...

2006-08-02 Thread Gordon Stewart
On 8/2/06, Pete <[EMAIL PROTECTED]> wrote: > Can't you use > if($max-$min<0.019){ ? why would I want things difficult for myself :) I'll use 'round'... - Seems easier.. (Multiply by 100 etc) -- G NZ community groups - [EMAIL PROTECTED] NZ-Website space offered. Community email addresses

Re: [php-list] Money Calculations...

2006-08-02 Thread Pete
In message <[EMAIL PROTECTED]> , Gordon Stewart <[EMAIL PROTECTED]> writes >Hi there, I've come accross a situation, where I am subracting amounts >from each other - it SHOULD come to whole cents, but im getting >strange results :- > >CODE :- > >echo "MIN MAX '$min'$max'\n"; >if($max-$min<0.02){ >e

Re: [php-list] Money Calculations...

2006-08-02 Thread Phill Sparks
I do not know of a single command that will do that, though the http://uk.php.net/round command will work round($number, 2); On 02/08/06, Gordon Stewart <[EMAIL PROTECTED]> wrote: > > Hi there, I've come accross a situation, where I am subracting amounts > from each other - it SHOULD come to whol

[php-list] Money Calculations...

2006-08-02 Thread Gordon Stewart
Hi there, I've come accross a situation, where I am subracting amounts from each other - it SHOULD come to whole cents, but im getting strange results :- CODE :- echo "MIN MAX '$min'$max'\n"; if($max-$min<0.02){ echo ($max-$min)."\n"; (Basically i want to know if its less than 2 cents differenc