Plumtree EDK (Enterprise Web Development Kit) 5.4.0 |

# ISearchResult.GetFieldAsInt Method

Gets the value of the specified `Field` as an `int`.

int GetFieldAsInt(
Field field
);

#### Parameters

field
  `Field` to evaluate

#### Return Value

`int` value of field

#### Remarks

Note that numbers are converted in the search server to a `float`; getFieldAsInt will then convert the float to an int.

#### Exceptions

Exception Type | Condition
--- | ---
InvalidCastException | if the value of the field is not of type int or the value is `null`. Use `GetFieldAsObject()` to check if the value is `null`.
ArgumentException | if the field is not present in this `ISearchResult`

#### See Also

ISearchResult Interface | Plumtree.Remote.PRC.Search Namespace