Re: Sum not producing zero

2008-03-12 Thread Tom Phoenix
{ return $is_credit ? "$formatted-" : "$formatted "; } Why do some formats add trailing spaces for positive numbers, but some don't? And the question I hate to ask: Are you or your manager going to spend much of next month wishing you'd started this t

RE: Sum not producing zero

2008-03-12 Thread Moon, John
$formated . ' '; } } John W Moon http://dmspulsesurvey.myflorida.com/is -----Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2008 9:05 AM To: Perl Beginners Subject: Re: Sum not producing zero Mo

Re: Sum not producing zero

2008-03-12 Thread John W. Krahn
Moon, John wrote: Below is a small script and results... Can someone example what I am doing wrong - the sum should produce zero but does not. http://perlmonks.org/?node_id=665673 perldoc -q perldoc perlnumber John -- Perl isn't a toolbox, but a small machine shop where you can

RE: Sum not producing zero

2008-03-12 Thread Thomas Bätzler
Hi, > Below is a small script and results... Can someone example > what I am doing wrong - the sum should produce zero but does not. Don't use floating point math for accounting - convert your money sums to cents first and use these for calculation. HTH, Thomas -- To unsubscribe, e-mail: [E

Re: Sum not producing zero

2008-03-12 Thread Gunnar Hjalmarsson
Moon, John wrote: Below is a small script and results... Can someone example what I am doing wrong - the sum should produce zero but does not. First, you run your code without having enabled strictures and warnings. Second, you probably want to study the FAQ entry "perldoc -q decimals". -

Sum not producing zero

2008-03-12 Thread Moon, John
Below is a small script and results... Can someone example what I am doing wrong - the sum should produce zero but does not. #!/usr/local/bin/perl use vars qw($this_account_total $this_customer_total $this_run_total); while () { chomp; my ($amt_gj, $amt_adj) = split /,/;