I have this \foreach
statement which results in even numbers with decimals. I would like to omit or hide the decimal from the results. How can this be done simply? I have seen a few answers to much more complicated queries, but I can find a way to marry those solutions to my question.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{snakes,backgrounds,arrows,decorations.markings}
\begin{document}
%
%
\begin{center}
\begin{tikzpicture}
\draw [<-] (0,7) -- (0,3.8)
node [at start,left] {$A.$};
\draw [->] (-0.2,4) -- (3,4);
\foreach [evaluate=\y as \yeval using \y*10] \y in {4,5,6,7}
\draw (-2pt,\y) -- (2pt,\y)
node [anchor=east,left] at (0,\y) {$\small \yeval$};
\end{tikzpicture}
\end{center}
%
%
\end{document}
int(\y*10)
instead of\y*10
...\y*10
to\y0
will give desired labels. But I don't know if it breaks the plot in other ways.{\small \pgfmathprintnumber{\yeval}}
, the number will be automatically rounded. This macro allows you to control the number output very flexibly, without changing the calculation of the value.