in reply to Simple calculation.

Eg. rounding to the nearest integer works above, but how about if the inputs are: 0.022 .. 0.086 by 10?

Kinda like dollars/cents, multiply by 1000 (or 10**$precision) ?

!google calculate the best Interval between tick marks -> http://stackoverflow.com/questions/14923812/displaying-axis-from-min-to-max-value-calculating-scale-and-labels

-> http://stackoverflow.com/questions/361681/algorithm-for-nice-grid-line-intervals-on-a-graph -> http://search.cpan.org/dist/Chart-Math-Axis/lib/Chart/Math/Axis.pm

  • Comment on Re: calculate the best Interval between tick marks (dollars cents)

Replies are listed 'Best First'.
Re^2: calculate the best Interval between tick marks (dollars cents)
by BrowserUk (Patriarch) on May 09, 2015 at 08:50 UTC
    http://stackoverflow.com/questions/14923812/displaying-axis-from-min-to-max-value-calculating-scale-and-labels

    Dog! I hate that site: So many jumped up little hitlers and so much dross.

    1. Eg. "(EDIT -- I've found an implementation of Scale1() that I did in Perl)" Liar. The code he posted contains (amongst others):
      • use strict;
      • @vInt = {1, 2, 5, 10};
      • if ($xMaxp < $xMax) $xMaxp = $xMax;
      • $par = (-3.1, 11.1, 5, 5.2, 10.1, 5, -12000, -100, 9);
    2. Another "perl" answer contains (amongst others):    $label_arr[] = array('label' => $label, 'x_pos' => $width_between * $i);.

    Not sure what's worse. Trying to decode Javascript kiddy "perl"; or the COBOLFortran?! they were trying to transcribe :)

    Damn! I'd forgotten just how horrible '70s languages were.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
    In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked