So I am loading a csv file that looks something like this:
est;dens;mwp
ols11;0.1;.
ols12;0.09;0.001
I want to use the following code to divide two numbers. I use the .csv in a table, but I also refer to them in the text, and would like this to be automated. But I get the following error from the code: Missing number, treated as zero.
for the line \basiceval{\x/\y}
. I am not very experienced with evaluating numbers in LaTex, so any help would be appreciated!
\documentclass{article}
\usepackage{datatool}
\DTLsetseparator{;}
\DTLloaddb{mun_reg}{63_mun_result.csv}
\def\basiceval#1{\the\numexpr#1\relax}
\begin{document}
\def\x{\DTLfetch{mun_reg}{est}{ols11}{dens}}
\def\y{\DTLfetch{mun_reg}{est}{ols12}{dens}}
\basiceval{\x/\y}
\end{document}