Min/Max numeric search returning odd results Following on from my earlier search question...

Searching for entries across multiple fields including a relationship

I'm finding that the min/max wage search behaves oddly.

I have a range of wage values from 95 to 175. 

If I search for a min of 95 with no max then I only get results from 95 up to 100.

Likewise if I search for a max value of 150 then I only get results greater than 100 and less then or equal to 150.

If I use both min and max criteria then I get no results.

I'm guessing this is something to do with variable type but can't see how I can force the variables to be integers/numbers rather than strings.

The simplified code I'm using to do the matching is:

{% set wage_from = craft.request.getParam('wage_from') ? craft.request.getParam('wage_from') : 0 %}
{% set wage_to = craft.request.getParam('wage_to') ? craft.request.getParam('wage_to') : 9999 %}

{%
  set results = craft.entries({
      section: 'vacancies',
        wage: [
          'and',
          '&gt;= ' ~ wage_from,
          '&lt;= ' ~ wage_to,
        ]
    })
%}
Aha! Another lightbulb moment.

The wage field was set to be plain text. I changed it to number and things work as expected.