[OS X TeX] Calculate with LaTeX and fp.sty

Friedrich Vosberg vatolin at mac.com
Sun Feb 5 22:58:20 CET 2006


Morning.

I've spent the whole weekend but did not find a solution.

Does somebody of you have an idea, how to calculate the following  
example including the hidden part in which the result of the previous  
calculation should be processed?

===== 8>< =====
\documentclass{minimal}
\usepackage{fp}
\usepackage{numprint}
%
\newcommand{\rtink}[1]{%
     \def\Inkasso{#1}
     \def\RVGInkasso{%
         \FPiflt{#1}{2500.01}
             \FPset{\sum}{#1}%
             \FPmul{\sum}{\sum}{.01}%
             \FPround{\sum}{\sum}{2}%
             \numprint{\sum}%
         \else%
         \FPiflt{#1}{10000.01}
             \FPset{\sum}{#1}%
             \FPsub{\sum}{\sum}{2500.00}%
             \FPmul{\sum}{\sum}{.005}%
             \FPadd{\sum}{\sum}{25.00}%
             \FPround{\sum}{\sum}{2}%
             \numprint{\sum}%
         \else%
         \FPifgt{#1}{10000.009}
             \FPset{\sum}{#1}%
             \FPsub{\sum}{\sum}{10000.00}%
             \FPmul{\sum}{\sum}{.0025}%
             \FPadd{\sum}{\sum}{62.50}%
             \FPround{\sum}{\sum}{2}%
             \numprint{\sum}%
         \fi
     }%
}%
%\def\jav{1234}
%\def\rtrvg{%
%   \FPset{\sum}{\RVGInkasso}
%   \FPsum{\sum}{\sum}{\jav}
%   \FPround{\sum}{\sum}{2}
%   \numprint{\rtrvg}
%}%
\begin{document}
\rtink{4000}
\Inkasso\\
\RVGInkasso\\
%\rtrvg
\end{document}
====== ><8 =====

A lot of TIA and kind regards. Friedrich


--
Stau ist nur hinten blöd, vorne geht's!


------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the macostex-archives mailing list