# help:number syntax

Number syntax has two different forms, depending on whether it's part of a field search or a post search.

#### Integer / Float / Datetime / Interval fields

When searching with numbers, the following variation in search parameters may be used.

##### Direct comparisons

These take the text field in its entirety when making the comparison as selected by the qualifier. The following qualifiers are available.

- (No qualifier) - Basic comparison.
`*_not`

- Basic comparison (negated).`*_eq`

- Direct comparison.`*_not_eq`

- Direct inequality comparison.`*_gt`

- Greater-than comparison.`*_gteq`

- Greater-than or equal comparison.`*_lt`

- Less-than comparison.`*_lteq`

- Less-than or equal comparison.

*Example:*

search[id_eq]=100

Searches for records where the ID is 100.

##### Basic syntax

###### Multiple values

- 100,200,300 (the values 100, 200 and 300)

###### Less than or equal to

- <100 (less than only)
- <=100 (less than or equal to)

###### Greater than or equal to

- >100 (greater than only)
- >=100 (greater than or equal to)

###### Intervals

- 100..200 (all numbers between 100 and 200, inclusive)
- 100...200 (all numbers between 100 and 200, excludes 200)
- ..100 (equivalent to <=100)
- 100.. (equivalent to >=100)

*Note: intervals only work from low to high, i.e. 100..200 will work while 200..100 won't.*

###### Combination values/intervals

- 98,100..200,202 (all numbers between 100 and 200, inclusive, plus 98 and 202)

###### Absolutes

- none (null values)
- any (non-null values)

#### Post search

In post searches, the syntax goes like this:

[metatag]:[number]

*Example:*

Values can be passed in using the basic syntax.

*Examples:*

width:<=100 mpixels:5.. id:100..200

###### Metatags where basic syntax can be used

`id`

`width`

`height`

`score`

`mpixels`

`ratio`

`filesize`

`age`

`date`

`tagcount`

`gentags`

`arttags`

`chartags`

`copytags`

`pixiv`

`pixiv_id`

###### Metatags where basic syntax cannot be used

`limit`

`parent`

`child`

`pool`

##### Units

With certain metatags, units are used. The basic syntax works the same with units.

Syntax:

[metatag]:[number][unit]

*Example:*

age:..10weeks

###### Age units

These units are used together with the *age* metatag.

- seconds (s)
- minutes (mi)
- hours (h)
- days (d)
- weeks (w)
- months (mo)
- years (y)

The shorthand version is in parenthesis. You can use any number of characters between the shorthand version and full version. For example, "se" or "sec" work in place of s or seconds.

*Example:*

age:2weeks..1mo

*Note: not specifying the time unit is no longer supported and will return no results. "m" will also return no results as it is ambiguous between minutes and months.*

*Note: singular and plural forms of units can be used interchangeably.*

###### Filesize units

These units are used together with the *filesize* metatag.

- b (bytes)
- kb (kilobytes)
- m (megabytes)

Only the shorthand versions will work, i.e. bytes, kilobytes and megabytes are not part of the syntax.

*Example:*

filesize:<=10kb

*Note: if no unit is specified it defaults to bytes.*

*Note: for anyone curious, 1m = 1024kb and 1kb = 1024b.*

###### Ratios

For the metatag *ratio*, fractions are commonly used but you may use decimal notation also.

The aspect ratio denotes the relationship between the width and height of an image. For example, a 1:1 ratio means the width and height are equal whereas a 4:3 ratio means the width is one third longer (4/3) than the height. Useful aspect ratio tool: http://andrew.hedges.name/experiments/aspect_ratio/

Syntax:

ratio:[width]/[height] ratio:[number]

*Examples:*

*Note: colons are supported in place of slashes; e.g., ratio:16:9.*

*Note: using ratios won't always result in pixel perfect results as the ratios are rounded to two decimal points, i.e. a search for ratio:16/9 may result in a picture with the dimensions 1920x1078 instead of 1920x1080.*

###### Why should you use ratios?

Ratios can be used to assist in finding wallpapers. For example, if you have a 1920x1080 monitor, you can use ratio:16/9 width:>=1920 to find wallpapers for it.

###### Tip

If you want to avoid calculating ratios altogether, then you can use dimensions directly.

*Example:*

ratio:1920/1200 is equivalent to ratio:8/5

###### Basic syntax

You can use basic syntax with ratios; though, take note if you use fractions.

First, the site will calculate all fractions into a decimal notation and round it off to two decimals, e.g. ratio:16:9 becomes ratio:1.78.

At this point it's regular numbers and normal basic syntax will work as expected.

*Example:*

ratio:16/10..16/9 becomes ratio:1.6..1.78 (Note: 16/9..16/10 won't work. See under Intervals on this page)

ratio:..16/9 becomes ratio:..1.78

#### See also

- Help:Cheatsheet (a complete list of tags and metatags)
- Help:Text syntax
- Help:Array syntax
- Help:API