I am trying to do specific actions based on the count of a certain character in a variable string.

When using the result of `StrCount` inside an `ifnumgreater`, I get an error despite the value being processed properly.

I think that the `StrCount` is not processed as an integer but it does output the correct value (after `2¿2` which appears to be an error).

Any idea of how to resolve this?

### MWE

```
\documentclass[draft]{article}
\usepackage{mwe}
\usepackage{etoolbox}
\usepackage{xstring}
\newcommand{\foo}{\StrCount{test}{t}}
\newcommand{\res}{}
\ifnumgreater{\foo}{0}{
  \renewcommand{\res}{yes}
}{\renewcommand{\res}{no}}
\begin{document}
\res
\end{document}

```

### Output

[![output](https://i.stack.imgur.com/4FeAd.png)](https://i.stack.imgur.com/4FeAd.png)

### Error log

[![error-log](https://i.stack.imgur.com/OSSYr.png)](https://i.stack.imgur.com/OSSYr.png)

```
./test.tex:7: Missing number, treated as zero.
<to be read again> 
                   \let 
l.7 \ifnumgreater{\foo}{2}
                          {
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

```