# help:number syntax

When searching with numbers, proper use of the number syntax will greatly improve your overall quality of life.

In search, the syntax goes like this:`[metatag]:[number]`

*Example:*

id:<=100

Number syntax can be used almost anywhere numbers are included in the search, e.g. *id*, *width*, *age* etc. Though, in certain instances number syntax will not work, e.g. when searching for pools.

#### Basics

###### Less than or equal to

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

###### Greater than or equal to

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

###### Intervals

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

*Examples:*

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

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

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

*id*, *width*, *height*, *score*, *mpixels*, *ratio*, *filesize*, *age*, *date*, *tagcount*, *gentags*, *arttags*, *chartags*, *copytags*

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

*pixiv*, *limit*, *parent*, *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.

*Example:*

age:2weeks..1mo

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

*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: 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?

It can prove to be useful in some cases. Say, you have a sick dual monitor setup with two 1920x1200 monitors, one in landscape and the other in portrait. You want a wicked wallpaper with matching aspect ratio for the portrait monitor, and you want to avoid upscaling.

Do the following search: ratio:5:8 height:>=1920

It will result in posts with a 5:8 ratio (1920x1200 in portrait) while keeping the height to a minimum of 1920 which will ensure that only downscaling may be used.

###### 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:search (introduction to search)
- help:cheatsheet (a complete list of tags and metatags)