3

I keep getting the error Dimension too large when i make my \Desktops{80} and my \DTUnits{20} however if I change my \DTUnits{14} it works, can someone help me please?

\documentclass[a4paper,12pt]{article}

\usepackage{times,helvet,pgfplots,transparent}


%------------------------------------------------------------

\begin{document}

\letterHead

\begin{Contract}

\begin{SLAInfo}

%*******************ONLY CHANGE INFO BELOW!!!!******************


\date{27 May 2013}
\effectiveDate{1 June 2013}
\theirName{SAMWU}
\theirRep{MR. Conrad Groendevelt}
\theirPosn{Management}
\theirAddress{17 TERMO AVENUE, TEGNOPARK, STELLENBOSCH.}





\Desktops{80}
\Laptops{0}
\Macs{0}

\Servers{3}

\DTUnits{20}
\ServUnits{6}

\KM{30}


\ReportsNeededPerSite{0}





\Takeon{0}


\SLATotal{0}






%*******************ONLY CHANGE INFO ABOVE!!!!******************


\Printers{0}
\author{Mr. Alex Masters}
\ourRep{Alex Masters}
\title{\cntrctTheirName\ \textbf{- SLA}}
\docId{SLA - \cntrctTheirName}

\terms{7}
\deposit{}
\escalation{10\%}
\head

%------------------------------------------------------------
\begin{PaymentSchedule}\label{payment}

The following pricing table includes once-off setup and deployment, and support.

\begin{OnceoffMonthYearPrices}{}
\priceItem{}{}{}{}


\ifnum\ecTakeon=0 %
        \priceItem{Take on Audit of all Desktop/s, Laptop/s and Sever/s}{R \pgfmathparse{int((25*\ecDesktops)+(25*\ecMacs)+(25*\ecLaptops)+(250*\ecServers)+(1000*\ecReport))}\pgfmathresult -00}{}{}
\else %
    \priceItem{Take on Audit of all Desktop/s, Laptop/s and Sever/s}{R \ecTakeon-00}{}{}
\fi



    \priceItem{}{}{}{}


\ifnum\ecDesktops=0 %
    %
\else %
%R 90 per Desktop/Laptop
    \priceItem{\mhmon of \fillinField{\bf{\ecDesktops}} x Desktop/s.}{}{}{}
\fi

%R 90 per Macbook
\ifnum\ecMacs=0 %
    %
\else %
    \priceItem{\mhmon of \fillinField{\bf{\ecMacs}} x Apple Mac/s.}{}{}{}
\fi

\ifnum\ecLaptops=0 %
    %
\else %
%R 90 per Desktop/Laptop
    \priceItem{\mhmon of \fillinField{\bf{\ecLaptops}} x Laptop/s.}{}{}{}
\fi

%R 350 per Server
\ifnum\ecServers=0 %
    %
\else %
    \priceItem{\mhmon of \fillinField{\bf{\ecServers}} x Server/s with Raid 1.}{}{}{}
\fi

    \priceItem{}{}{}{}


%-------MHSUPPORT STUFF BELOW--------------

\ifnum\ecDesktops=0 %
    %
\else %
    \priceItem{\mhsupp for \fillinField{\bf{\ecDesktops}} x Desktop/s (\ecDTUnits\ Units).}{}{}{}
\fi

\ifnum\ecMacs=0 %
    %
\else %
    \priceItem{\mhsupp for \fillinField{\bf{\ecMacs}} x Apple Mac/s (Part of Desktop Units).}{}{}
\fi

\ifnum\ecLaptops=0 %
    %
\else %
    \priceItem{\mhsupp for \fillinField{\bf{\ecLaptops}} x Laptop/s (Part of Desktop Units).}{}{}{}
\fi

%R 450 per Unit
\ifnum\ecServers=0 %
    %
\else %
    \priceItem{\mhsupp for \fillinField{\bf{\ecServers}} x Server/s with Raid 1 (\ecServUnits\ Units).}{}{}{}
\fi

    \priceItem{}{}{}{} \hline \hline


\ifnum\ecSLATotal=0 %
    \priceItem{Total}{}{R \pgfmathparse{int((90*\ecDesktops)+(90*\ecMacs)+(90*\ecLaptops)+(350*\ecServers)+(350*\ecDTUnits)+(450*\ecServUnits)+(12*\ecKM))}\pgfmathresult -00}{}\hline \hline

\else %
    \priceItem{Total}{}{R \ecSLATotal-00}{}\hline \hline
\fi

\end{OnceoffMonthYearPrices}



\end{PaymentSchedule}

%------------------------------------------------------------

\end{SLAInfo}

\end{Contract}

\end{document}
2
  • Welcome to TeX.SX! You can have a look on our starter guide to familiarize yourself further with our format. Jun 10, 2013 at 15:48
  • 1
    Please reduce your example to known packages. You input of /Tex/Permdocs/7clegal isn't part of any TeX installation. Jun 10, 2013 at 15:49

1 Answer 1

6

This happens because the value you're trying to calculate is larger than the TeX engine can handle. For working with large numbers, use the fpu library. You load it with \usetikzlibrary{fpu}, and activate it using \pgfkeys{/pgf/fpu=true, /pgf/fpu/output format=fixed}. The math expressions can usually remain unchanged.

It's usually a good idea to use \pgfmathprintnumber{\pgfmathresult} to print the result of a calculation, instead of using \pgfmathresult directly. The \pgfmathprintnumber macro takes care of rounding values, if necessary, and can be used to format numbers consistently (think thousands and decimal separators, for example).

\documentclass{article}

\usepackage{pgfplots}

\begin{document}

\def\Desktops{80}
\def\Laptops{0}
\def\Macs{0}    
\def\Servers{3}   
\def\DTUnits{20}
\def\ServUnits{6}    
\def\KM{30}

\pgfkeys{/pgf/fpu=true,/pgf/fpu/output format=fixed}
\pgfmathparse{(90*\Desktops)+ (90*\Macs)+ (90*\Laptops)+ (350*\Servers)+ (350*\DTUnits)+ (450*\ServUnits)+ (12*\KM)}

Total: \pgfmathprintnumber[1000 sep=\,]{\pgfmathresult}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .