I want to convert decimal number to integer in latex program with Visual Tex IDE. I found this function \pgfmathparse{ceil(2.7)} which requires installing the package pgfmath and pgfkeys. And after conversion I need to add two numbers. I tried using \numexpr (for integers) and \dimexpr (for decimals). But both functions simply concatenate those two values.
I don't know how to install packages in Visual Tex. Could someone suggest me how to install a package in Visual TeX. Or Could someone suggest me if there is any other function in calc package through which I can get ceil.
\documentclass{article}%
\usepackage{calc}%
\begin{document}%
\newcommand{\addnum}[2] {%
\def\numa{#1}
\def\numb{#2}
\def\deca{#3}
\def\decb{#4}
Int Sum is \numexpr\numa+\numb\relax
Dec Sum is \dimexpr\deca+\decb\relax
}%%
\addnum{10}{20}{30.45}{55.63}%
\end{document}%
It gives below output:
Int Sum is 10+20 Dec Sum is 30.45+55.63
This program works in MiKTeX. But I want it to work on Visual Tex IDE. I set the output mode as PDF.
\numexpr. – Joseph Wright May 12 '15 at 19:23Undefined control sequenceorYou can't use\numexpr' in vertical mode`. – egreg May 12 '15 at 19:34