\documentclass[pagesize=auto, fontsize=12pt, DIV=11, parskip=half]{scrartcl} \usepackage{fixltx2e} \usepackage{etex} \usepackage{lmodern} \usepackage[T1]{fontenc} \usepackage{textcomp} \usepackage[svgnames]{xcolor} \usepackage{listings} \usepackage{microtype} \usepackage{hyperref} \newcommand*{\mail}[1]{\href{mailto:#1}{\texttt{#1}}} \newcommand*{\pkg}[1]{\textsf{#1}} \newcommand*{\cs}[1]{\texttt{\textbackslash#1}} \makeatletter \newcommand*{\cmd}[1]{\cs{\expandafter\@gobble\string#1}} \makeatother \newcommand*{\meta}[1]{\textlangle\textsl{#1}\textrangle} \newcommand*{\marg}[1]{\texttt{\{}\meta{#1}\texttt{\}}} \addtokomafont{title}{\rmfamily} \lstset{% language=[LaTeX]TeX,% columns=flexible,% upquote=true,% numbers=left,% basicstyle=\ttfamily,% keywordstyle=\color{Navy},% commentstyle=\color{DimGray},% stringstyle=\color{SeaGreen},% numberstyle=\scriptsize\color{SlateGray}% } \title{The \pkg{sepnum} package\thanks{This manual corresponds to \pkg{sepnum}~v2.0, dated~1996/09/05.}} \subtitle{Separated numbers} \author{Bernd Raichle\thanks{\mail{Raichle@Informatik.Uni-Stuttgart.de}}} \date{1996/09/05} \begin{document} \maketitle \begin{abstract} \noindent This package provides a means of formatting numbers with (a) a decimal separator different of the default (`.') and (b) a separator (default `,') every three digits. First version of this package was posted to the newsgroup `\texttt{de.comp.tex}' November 6th, 1995 (as `\pkg{printnum.sty}'). \end{abstract} \section{Licensing condition} This program may be redistributed and/or modified under the terms of the \LaTeX\ Project Public License, either version~1.0 of this license, or (at your option) any later version. The latest version of this license is in \href{http://ctan.org/macros/latex/base/lppl.txt}{\texttt{CTAN:macros/latex/base/lppl.txt}}. \section{Usage} The macro % \begin{quote} \cmd{\sepnum}\marg{c}\marg{sbc}\marg{sac}\marg{number} \end{quote} % produces the \meta{number} with the decimal point replaced by \meta{c} and the separator \meta{sbc} every three digits in the integer part, the separator \meta{sac} every three digits in the fractional part of \meta{number}. \cmd{\sepnum} is \emph{fully expandable} and \emph{not} fragile, unless one of \meta{c}, \meta{sbc}, or \meta{sac} is. \minisec{Example:} % \begin{itemize} \item a non realistic example to show the capabilities of \cmd{\sepnum} \\ \verb|\sepnum{,}{*}{-}{1234.5678}| $\Rightarrow$ 1*234,567-8 \item to print a number inserting small spaces each three digits \\ \verb|\sepnum{.}{\,}{\,}{1234.5678}| $\Rightarrow$ 1\,234.567\,8 \end{itemize} Additionally this package provides % \begin{quote} \cmd{\sepnumform}\marg{c}\marg{sbc}\marg{sac}\marg{\LaTeX-counter} \end{quote} % to use \cmd{\sepnum} with a \LaTeX\ counter. \minisec{Example (with a decimal comma in the print form \cmd{\the\meta{counter}}):} % \begin{lstlisting} \newcounter{money} \renewcommand{\themoney}{\sepnumform{,}{.}{}{money}} \setcounter{money}{-1000} You have \themoney{} left. \end{lstlisting} % (For compatibility with `\pkg{printnum.sty}', the macros \cmd{\printnum}\marg{number} and \cmd{\print\-numKomma}\slash\cmd{\printnumTrenner} still exist.) \section{See also} \begin{itemize} \item Package ``\pkg{comma.sty}'' by David Carlisle which provides similar features for integers only, i.\,e.\ it misses support for the decimal point/comma in fixed point numbers. \item Package ``\pkg{numprint.sty}'' by Harald Harders supporting formatting of numbers given as \texttt{1234e5} in addition. \end{itemize} \end{document}