% Copyright 2009 by
% Thomas Deselaers <thomas@deselaers.de>
% Philippe Dreuw <dreuw@cs.rwth-aachen.de>


% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
%
% ChangeLog:
%   0.1 - first rounding release

\def\rounding@version{0.1}
\def\rounding@data{2009/12/04}
\def\rounding@msg{rounding: rounding numbers in LaTeX}
\typeout{Package: \rounding@data. v.\rounding@version. rounding@msg}

\NeedsTeXFormat{LaTeX2e}

\ProvidesPackage{rounding}[\rounding@data. v.\rounding@version. \rounding@msg]

\RequirePackage{fp}
\RequirePackage{tabularx}


\def\roundposition{2}

\newcommand{\rd}[1]{\edef\rounded{0}\FPeval\rounded{round(#1,\roundposition)}\rounded}


\def\rdtab#1#2 {%
  \edef\rounded{0}\FPeval\rounded{round(#2,\roundposition)}\rounded% w/ \ignorespaces inside a table
}
\newcolumntype{R}{>{\rdtab}r<{}}

