Smaller than / Greater than (being false)

  • I am having an issue with an IF statement being false.

    Scraped number: 3
    Variable: 10

    If statement:

    [[scraped number]] < [[Variable]]

    Am I doing something wrong here?

  • @Huntenkill
    How to correctly report about error?
    support ADMINISTRATORS 23 сентября 2017 г.
    The best way to solve your issue - create new topic with answers to these questions:

    Short bug description.

    Detailed bug description(optionally).

    Does problem reproduces in run or record mode?

    Project with minimal action number, which demonstrates problem

    BAS log.


    Additional files/accounts/proxies, which are required to run project(can send with PM).

    BAS version.

    OS version.

  • @Huntenkill Most likely you have an error with the data type. Try it like this

    parseInt([[scraped number]]) < parseInt([[Variable]])

  • @Huntenkill said in Smaller than / Greater than (being false):

    If statement:
    [[scraped number]] < [[Variable]]
    Am I doing something wrong here?

    string '3' is greater than string '10'

    I will not say that I have a shorter ...

    '3' < '10' // false
    +'3' < +'10' //true

    or likely

    +'3' < '10' //true

  • Thanks guys for the quick responses.
    Seems like if I don't put 10 as Variable and just "hardcoded" 10 it works.
    Which is strange to be honest :'D

Log in to reply