As you can see, my numbers in AVG are not accurately getting the average. Some of them are fine, some columns NEVER work.

Below is my output file.

qty search 1 search 2 search 3 search 4 search 5 min avg high 2 645 625 645 645 635 625 639 645 1 2,800 2,900 3,000 3,000 2,988 2,800 2.4 3,000 1 5,000 5,495 4,999 4,995 4,900 4,999 4.4 5,495 1 692 770 695 697 678 678 706. 4 770 1 1,949 1,949 3,580 2,900 2,989 1,949 1.8 3,580 1 5,000 5,000 4,950 5,000 5,000 4,950 4.8 5,000
As you can see, some averages are 2.4 and 4.4 and I have no idea why. Obviously the other numbers are correct. Below is my code.
my $avg = $se1+$se2+$se3+$se4+$se5; $avg = $avg /5;
any idea what the problem might be? $se# holds the numbers as seen in the data printout above.

In reply to Numbers aren't averaging correctly by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.