LaTeX forum ⇒ Math & ScienceProblem with FPeval and datatool

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Oelle74
Posts: 3
Joined: Wed Jul 06, 2016 11:23 am

Problem with FPeval and datatool

Postby Oelle74 » Thu Sep 02, 2021 9:40 am

Hi,

I would like to calaculate with numbers which I have imported via datatool.

Here is an example:

\documentclass[12pt,a4paper]{article}
\usepackage{amsfonts, amsmath, amssymb, latexsym, amscd}
\usepackage[latin1]{inputenc}
\usepackage[german]{babel}
\usepackage{datatool}
\usepackage{fp}

\begin{document}
\DTLsetseparator{;}
\DTLloaddb{Komm}{Komm_2005R_2010-12_0_5.csv}
\DTLsetseparator{,}
\newcommand{\D}[2]{\FPadd{\erg}{1}{#2}\FPround{\erg}{\erg}{0} \DTLgetvalue{\A}{Komm}{\erg}{\dtlcolumnindex{Komm}{D#1}} \A}

$\frac{1}{\D{xA}{43}}$

\FPeval{\result}{round(1+1/2,2)}
\result

\FPeval{\resultt}{round(1/\D{xA}{43},2)}
\resultt

\end{document}


The import works well, but the last two code lines don't work. Please find attached the csv-file which I use.

Can anybody help me please?
Attachments
Komm_2005R_2010-12_0_5.csv
(20.17 KiB) Downloaded 29 times

Recommended reading 2021:

LaTeXguide.org • LaTeX-Cookbook.net
LaTeX Beginner's Guide LaTeX Cookbook

Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 6 guests