> I am running a simple script that is reading through a text file and
adding up 
> floating point numbers from each line.
> At the 2165 line the number goes wrong. All the numbers are money \d+.\d\d
> all numbers in the hundreds to thousands.
> 
> I have removed lines thinking maybe something was screwy with the
data. If i 
> erase the line its the next on.
> If I am manually insert a line with a number it becomes that one.
> 
> 
> Code below.... (I know its ugly but its one of those 1 time scripts
that is  
> built as you go to massage the data) The only part that is relevent to
this 
> issue is the total counter. $total.
> 

Problem could be doing the floating point math. You might want to
consider translating your money values into pennies and using only
integer math, then going back to dollars at the end.  

perldoc perlnumber

For more...

http://danconia.org


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to