Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other How to detect an integer in a list of numbers

  • This topic is empty.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #37861
    GreenNuclear
    Member

    Hi,
    Wondering if anybody has ever solved this one. I see a couple of snippets that will tell if a number you put in is odd or even but none that will detect a whole number from the searches I made so far.

    Thanks in advance.

    #102049
    TheDoc
    Member

    Can you give an example of what you’ll be looking at?

    #102052
    GreenNuclear
    Member

    Hi Doc,
    In a column of numbers like this, I want the 0,1,2,3,4,5,6,7,8 rows.
    Sometimes the program skips an integer so then I need to plug in a virtual.

    George
    0
    0.0833
    0.1667
    0.25
    0.3333
    0.4167
    0.5
    0.5833
    0.6667
    0.75
    0.7667
    1
    1.3333
    1.35
    2
    2.1
    2.15
    2.2
    2.25
    2.3
    2.4
    2.45
    2.5
    2.55
    2.65
    2.7
    2.75
    3
    3.05
    3.1
    3.15
    4
    4.9833
    5
    5.05
    5.1
    5.15
    5.2
    5.25
    5.35
    5.4
    5.45
    5.5
    5.55
    5.6
    5.7
    5.75
    6
    6.25
    6.3333
    6.4167
    6.5833
    6.6667
    6.75
    6.7667
    7.0833
    7.1667
    7.2
    7.25
    7.3333
    7.4167
    7.45
    7.5
    7.5833
    7.6667
    7.7
    7.75
    7.8333
    8
    8.0833
    8.1667
    8.25
    8.3333
    8.4167
    8.5
    8.5833
    8.6667
    8.75

    #102056
    TheDoc
    Member

    Hopefully this helps!

    http://jsfiddle.net/Jk5mA/

    #102078
    GreenNuclear
    Member

    Thanks Doc,

    I am seeing the same problem there that I am trying to solve.
    That snippet detects the change in the integer and prints it, ignoring the decimals after the ” . ” It gets the first integer but then on the
    next row the trouble starts.

    George

    #102080
    Mottie
    Member

    Hi George!

    What results are you expecting? Maybe I’m not understanding but what you mean by “on the next row the trouble starts”. Do you want integers only? or the entire number? Are they supposed to be sorted into rows?

    #102099
    GreenNuclear
    Member

    Hi Mottie,

    If you look at this http://jsfiddle.net/Jk5mA/ you will see what I am trying to separate. I only want whole numbers which means nothing past the decimal point out to the capacity of the program. The 1,2,3,
    etc, integers in the list are the ones to separate from the others. This list is a derivative from a time series list of seconds incrementing. I want to be able to find minutes and hours in that list. Sometimes, the seconds skip so there is another problem too. I will need to make a virtual whole number at the point it skips.

    Thanks for your interest and help

    George

    #102113
    Mottie
    Member

    Hmm, sounds like a pretty long list.

    So did you want to round the numbers or just truncate them?

    The result table will list as seconds? So how will you determine the number of minutes, hours, etc? will that be another column?

    What value will be set to the seconds that are skipped? If there are no values, then why not just count seconds from one to the highest number in the list?

    #102154
    GreenNuclear
    Member

    Hi Mottie,

    You may have your finger on it. It is easy to add columns for minutes, hours, etc. What I am trying to do is to limit the number of BIN files.
    This may do the trick.

    Thanks,
    George

    #102194
    GreenNuclear
    Member

    Hi Schmotty,

    Great idea! Works like a charm and saves many BIN files.

    George

Viewing 10 posts - 1 through 10 (of 10 total)
  • The forum ‘Other’ is closed to new topics and replies.