Compare a variable to a number

I knew I had done this before but couldn’t remember the details… on checking I had put a ticket about this up last year and put the solution in it: